Following well-known rules of HTML-family languages, line breaks and space characters have the same meaning.
The following two snippets are equivalent:
<span>a</span> <span>b</span>
<span>a</span>
<span>b</span>
In some cases, the object of human readability and the length of certain span blocks give an advantage to placing them on a separate lines, even though the extra whitespace is undesired in the rendered display.
That is, it may be desired that the second example above, or some similar structure, were rendered by the HTML display environment the same as would be expected the following:
<span>a</span><span>b</span>
To be clear, the short blocks are given for illustration, but in an actual application may be vastly longer.
Is any HTML or CSS functionality offered to cause the example with the line break to be rendered without whitespace?
The solution must be static and portable. No JavaScript is allowed.
The cleanest solution I have found involves inserting the line break either inside one of the <
/>
bracket pairings, or inside a new <!--
/-->
comment:
<span>a</span><!--
--><span>b</span>