The linebreaks are causing it – http://jsfiddle.net/RhvjF/1/
Can’t find the particular post, but smart people suggested 3 ways of fixing it:
- Put everything in one line (remove all line breaks)
-
Comment out the line breaks, like
<span style="display: inline">Hello Wo</span><!-- --><span style="display: none;"></span><!-- --><span style="display: inline">rld</span>
-
Set the container
font-size
to0
and re-set it forspan
-s
UPDATE
There are at least 2 more ways:
-
Break the tags, like
<span style="display: inline">Hello Wo</span ><span style="display: none;"></span ><span style="display: inline">rld</span>
- Float the elements, i.e.
span { float: left }