Unpacking Internet Explorer 8's multiple rendering modes
Internet Explorer 8 is going to be the most standards-compliant IE yet, but it's going about it in a way that has some people scratching their heads. With Internet Explorer 8, you have a choice in standards compliance modes. Sound oxymoronic? Shouldn't there be one standards mode by default? Heck, shouldn't the only mode be standards mode? Ah, idealism.
One of the nastier things about being a web developer, I'm told, is the existence of Internet Explorer. Massively popular, but full of "quirks," coding around IE can be a real pain. When IE7 shipped, many web developers recoiled in horror as sites that worked fine in IE6 broke.
The problem, as is so often the case, is backwards compatibility. IE5.5 (and below) was decidedly nonstandard in its rendering behavior. Hundreds of millions of web pages were written to look "right" in IE5.5's broken rendering. The result was something of a quandary for Microsoft when it came to release IE6. They wanted to improve the standards conformance in IE6, but couldn't afford to break pages dependent on the older behavior.
The solution was the "doctype switch". The doctype switch allowed IE6 to support both the old IE5.5 behavior—"quirks mode"—and new, more standards-conforming behavior—"standards mode." Doctypes are an optional part of HTML pages, which specify which version of the HTML spec a page is using. In the olden days of the web, most web pages didn't bother to specify—they barely heeded the mandatory parts of the standards, let alone optional parts. So the presence of the doctype could be used to pick between modes—if someone used a doctype, they probably knew what they were doing, and wanted "standards mode." No doctype (or a doctype specifying an old version of HTML) and they were probably assuming nonstandard behavior, and "quirks mode" would be picked.