Tuesday, March 14, 2006

Quirks vs Standards Mode - what's the difference?

Great post by Tedster on Webmasterworld about Quirks Mode vs Standards Mode...

"
There's been some question (sometimes a lot of questions) about what quirks mode is, and the parallel question, what standards mode is.

Up until version 6 browsers, there was a lot of non-standard rendering built into user agents. A lot of this behavior didn't conform to the W3C rendering recommendations at all, but it was what we worked with and we got very used to it.

And then came the move to standards, with Document Type Declarations (DTD) and all that. But how can new browsers handle those legacy pages all, over the web that depend on "quirky" behavior in order to look good?

That became the question, and the answer is "quirks" mode.

If a browser sees a full DTD as the FIRST element of a document, including the W3C URL for the details, then it renders the page in "standards" mode. Because standards are still relatively young, there is some variation from one browser to another, but it's usually minor.

But if a browser sees no DTD, or a partial DTD, then it goes into "quirks mode", which essentially means rendering the page the wrong way, but the way we were used to up until version 6".

No comments: