In order to break long lines of text in the HTML source (because I prefer source code that approaches human readability) without introducing whitespace when rendered, I have used source similar to
<! DOCTYPE HTML>
<html>
<body>
<p>
Span<span/
>in<span/
>the<span/
>place<span/
>where<span/
>you<span/
>live.
</p>
</body>
</html>
Which renders something like
Spanintheplacewhereyoulive.
However, I am not sure why this seems to work (using recent Chrome and Firefox, and a version of Konqueror). The standard seems not to cover this situation, unless I have missed it. A related post suggests to me that the above example is not valid, insofar as the <span/ >
tags are concerned.
Not sure it matters, but I want to emphasize that there is whitespace between the /
and >
in <span/ >
. This is lexically distinct from <span />
and <span/>
, although I don't know if it's semantically different.
Why does <span/ >
render, producing an empty span? Am I accessing some browser-specific behavior?
Appendix
As far as I can tell, a correct way to break an empty span would be, for example, "Broken Up":
<! DOCTYPE HTML>
<html>
<body>
<h2>
Continuous
</h2>
<p> /this/is/a/path/that/seems/not/to/end/it/goes/on/and/on/my/friend/someone/started/typing/it/not/knowing/what/it/was/and/they/will/continue/typing/a/long/time/because/this/is/a/path/that/seems/not/to/end/it/goes/on/and/on/my/friend/someone/started/typing/it/not/knowing/what/it/was/and/they/will/continue/typing/a/long/time/because
</p>
<h2>
Broken Up
</h2>
<p>
<!-- 6789012345678901234567890123456789012345678901234567890 -->
/this/<wbr>is/a/<wbr>path/<wbr><span></span
>that/<wbr>seems/<wbr><span></span
>not/to/<wbr>end/<wbr><span></span
>it/goes/<wbr>on/and/<wbr><span></span
>on/my/<wbr>friend/<wbr><span></span
>someone/<wbr>started/<wbr><span></span
>typing/<wbr>it/<wbr>not/<wbr><span></span
>knowing/<wbr>what/<wbr>it/was/<wbr><span></span
>and/<wbr>they/<wbr>will/<wbr><span></span
>continue/<wbr>typing/a/<wbr><span></span
>long/<wbr>time/<wbr>because/<wbr><span></span
>this/<wbr>is/a/<wbr>path/<wbr><span></span
>that/<wbr>seems/<wbr><span></span
>not/to/<wbr>end/<wbr><span></span
>it/goes/<wbr>on/and/<wbr><span></span
>on/my/<wbr>friend/<wbr><span></span
>someone/<wbr>started/<wbr><span></span
>typing/<wbr>it/<wbr>not/<wbr><span></span
>knowing/<wbr>what/<wbr>it/was/<wbr><span></span
>and/<wbr>they/<wbr>will/<wbr><span></span
>continue/<wbr>typing/a/<wbr><span></span
>long/<wbr>time/<wbr>because/
</p>
</body>
</html>