HTML comments break down HTML comments break down xml xml

HTML comments break down


Comments in the XML Spec from the w3.org :

For compatibility, the string "--" (double-hyphen) MUST NOT occur within comments.


If you really want to keep the comment in your page you could use this instead of an HTML comment:

<div style="display:none">command --option value --option2 value2 --option3 </div>

Or even

<div class="comment">command --option value --option2 value2 --option3 </div>

and specify:

.comment {display:none;}

in your stylesheet.


Comments at the top of the page before <html> will throw IE into quirks mode, which could explain why the page breaks, if that's where your comment appears.

For more information, check out the "Triggering different rendering modes" on this wikipedia page