Triggering quirks mode in IE

When XHTML was all the rage years ago, it was common knowledge that an XML prolog declared before the doctype will trigger quirks mode in IE6. That has been fixed in IE7.

However, I found out that actually anything at all, except for white spaces and the XML prolog, will trigger quirks mode in IE6, 7 and 8 for doctypes that should otherwise trigger standards mode.

So if someone decides to add <!-- $Id$ --> to the first line in the HTML file, it will trigger quirks mode in IE. Now you know too.

Leave a Reply