There is this quote from Microsoft:
<![if lt IE 8]>
<p>Please upgrade to Internet Explorer version 8.</p>
<![endif]>
When comparing this type of comment to
the basic HTML Comment, notice that
there are no hyphens (“–“)
immediately after the opening “” of
the comment block; therefore, the
comment delimiters are treated as
unrecognized HTML. Because the browser
does not recognize the
downlevel-revealed conditional
comment, it does nothing with it.
And there is the commonly known HTML5-Video Fallback solution.
<video ...>
<!-- If the browser doesn't understand the <video> element, reference a Flash file.-->
<embed ...></embed>
</video>
-
So what is happening witht he contents of an recognised Tag?
-
Is this standardized somehow or just up to the browser how to implement?
It’s standardized in HTML5.
There’s two different cases. For
<![if lt IE 8]>, this is processed in non IE browsers as a “bogus comment” and results in a comment node being added to the DOM. For what IE does, see Axel Fontaine’s answer.For
<video ...>browsers other than IE (version 8 or earlier) will create a element in the DOM called “video” and it’s contents will be children of the “video” element. IE, if the HTML5 shiv is used, will do the same thing.For IE prior to IE9, without the HTML5 shiv, the
<video ...>tag will cause one element called “VIDEO” will be created. It will be empty. The embed and any other contents will be siblings of it. Then the</video>tag will cause another element to be added to the DOM called “/VIDEO”As a side issue, the
<embed>element is void, so</embed>is never correct. Adding it causes an element called “/EMBED” to be added to the DOM in IE versions prior to IE9.