The HTML5 reference states:
A head element’s end tag may be omitted if the head element is not
immediately followed by a space character or a comment.
What does this “space character” restriction mean? I can only think that something like
<title>My Page</title><p>Some stuff.</p>
is valid, while
<title>My Page</title>
<p>Some stuff.</p>
is not, as the implicit </head><body> tags would not surround a newline. But I feel I’m off the mark. A clarifying example will be greatly appreciated.
Thanks to all!
It just means that since comments and space characters may appear inside the head element, they will not implicitly end the head element.
So if you want want the comment (for example) after the head element is closed and not just before it is closed, then you have to use an explicit
</head>i.e.
means the same as
and there is no way to represent
without using an explicit
</head>