In testing a site, I found some interesting quirky behaviors with IE. The CSS was syntatically correct and it confounded me why the visual flubs were smattering my site. Upon closer examination, I found that the site had no doctype.
Just a note, dear reader, that I came into this project after it was already written and was trying to eliminate some bugs as I was finding them.
So, there was no doctype. Interestingly, IE will throw the document into Quirks mode if no doctype is found. Did you know that? I sure didn’t.
Quirks mode refers to a technique used by some web browsers for the sake of maintaining backward compatibility with web pages designed for older browsers, instead of strictly complying with W3C and IETF standards in standards mode.
To sum up, it will make all versions of IE start to behave like IE5.5. Yikes, right? That’s what I thought. That’s actually the intended behavior, though. Just in case they had problems, developers could omit the doctype and thus have their tried & true version of IE. QuirksMode.org thoroughly explains it and tells us the rationale behind these decisions. It’s also called “DOCTYPE switching”.
Apparently all of this was already developed by the time I started learning web development, and so this was all new to me. Perhaps this will help you on a headachy night if you have to work on some code that relies on Quirks mode!
All references I found useful in learning about this matter: