MSIE's Semi-Quirks Mode

© 2011, Martin Rinehart

It is well known that putting a doctype on top of an HTML page switches browsers from quirks mode to standards mode. It is less well known that MSIE 7 and 8 (at least) have a "semi-quirks" mode for HTML doctypes.

For example the CSS selector "elem:hover" only works for <a> elements in MSIE, except in standards mode. It does not work for other elements in quirks or semi-quirks (semi-standards?) modes. Semi-quirks applies in MSIE if you use an HTML doctype. True standards requires XHTML.

Luckily for those of us on the frontend of this locomotive, that problem is going away. HTML5 provides for a simple doctype:

<!doctype html>

That simple doctype triggers standards mode in MSIE 8 and 9. (Oddly, MSIE 8 with the older doctypes still requires "XHTML" to avoid semi-quirks mode.) This means that we can drop "XHTML" from our doctypes just as soon as we can end support for MSIE 7. That would be when? 2015? 2016?

P.S. MSFT decided to auto-update MSIE 7 to MSIE 9. Thank goodness! MSIE 7 is no longer over 1% market share, and I no longer support it. September, 2013.

Feedback: MartinRinehart at gmail dot com

# # #