I am having a weird issue where I tend to think that a space should exist, but browsers clobber it. At the very least, I cannot quite understand the underlying logic for the behavior of how spaces are handled in elements that live inside an display: inline-block;
. For example:
<p>
Space in an inline: This will have no<span style="display: inline-block;" class="bold"> space in it.</span>
</p>
<p>
<span style="display: inline-block;">Space btw inlines: This will have a</span> <span style="display: inline-block;" class="bold"><span> space in it.</span></span>
</p>
<p>
Space in the span: This will have a<span> space in it.</span>
</p>
Produces the HTML display:
Space in an inline: This will have nospace in it.
Space btw inlines: This will have a space in it.
Space in the span: This will have a space in it.
Which is weird for a few reasons. First, in the first case, the space between no and space still exists. Copy and paste, and it will be in your text (see: http://jsfiddle.net/gdhgmj7g/2/). However, it won't be shown in the web page. Does anyone know the rules for how this is actually handled? Is this a bug or somehow intended behavior? Weirdest of all, the first case has a space in the span, you just can't see it unless you copy-paste the content. The second has a space between the inline spans, which then allows things to display reasonably. Likewise, in a normal paragraph (third case), things work as expected. This behavior occurs consistently for IE, Firefox, and Chrome, so I would assume some logic is behind it. But I have zero idea why it is.