
You’re developing a site using XHTML and CSS, testing in Internet Explorer, and it all seems to be going well … then you look at the layout with Firefox and Safari and realize it is displaying very differently to the way it’s rendering in Internet Explorer. What’s going on?
Internet Explorer bugs aside, the most likely issue is that Internet Explorer is rendering your document in quirks mode. Many modern browsers have two rendering modes. Quirks mode renders documents according to the buggy implementations of older browsers such as Netscape 4 and Internet Explorer 4 and 5. Standards or compliance mode renders documents as per the W3C specifications (or as close to it as they can).
? Documents that use older doctypes, are poorly formed, or lack a doctype declaration at all, display using quirks mode.
? Internet Explorer 6 will render in quirks mode if you include anything at all above the DOCTYPEstatement—including the XML prolog required for an XHTML doctype.
? Documents that are using strict HTML 4 or XHTML doctypes render using compliance mode.
The way browsers switch between quirks mode and compliance mode rendering based on the document’s doctype is called doctype switching. The solution is simple; use a doctype that will trigger compliance mode and make sure there’s nothing before your doctype declaration to keep IE6 happy.
If you would like to make a comment, please fill out the form below.
This web site is mostly a stroll-through for all of the info you wished about this and didn’t know who to ask. Glimpse here, and you’ll undoubtedly uncover it.