views:

184

answers:

3

In a lot of articles about design, quirks mode is mentioned. Anybody have an idea about this thing in plain text and in a development prospective?

+8  A: 

you can read in this links link :

http://en.wikipedia.org/wiki/Quirks%5Fmode

http://www.quirksmode.org/css/quirksmode.html

http://www.cs.tut.fi/~jkorpela/quirks-mode.html

Modern browsers generally try to render HTML content according to the W3C recommendations. However, to provide compatibility with older web pages, and to provide additional "intuitive" functionality, all browsers support an alternative "quirks mode".

Quirks mode is not, however, a standard. The rendering of any page in quirks mode in different browsers may be different. Whenever possible, it is better to adhere to the W3C standards and try and avoid depending on any past or present browser quirks.

Generally, quirks mode is turned on when there is no correct DOCTYPE declaration, and turned off when there is a DOCTYPE definition. However, invalid HTML - with respect to the chosen DOCTYPE - can also cause the browser to switch to quirks mode.

More information on the different quirks modes in different browsers can be found at QuirksMode.org

Haim Evgi
+2  A: 

Quirks mode means your page is running without a document type declared, the document type is defined at the very top of a page and it denotes how the browser should read the HTML. This is StackOverflows doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd"&gt;

w3.org specifies web standards and document types, because Stack Overflow uses this doctype it must adhere to the specification of that doctype.

This is HTML 4.01 Strict DTD, which excludes the presentation attributes and elements that W3C expects to phase out as support for style sheets matures. Authors should use the Strict DTD when possible, but may use the Transitional DTD when support for presentation attribute and elements is required.

Sam152
+1  A: 

In past days when web browsers did not have full/correct implementations of CSS, developers relied on these idiosyncrasies to make their pages render properly. However, as browsers became more standards-compliant, these pages no longer rendered correctly, as they were written for what bascially was a different type of CSS. This is where quirks mode comes in, as it handles pages written for these broken CSS implementations.

So in 2009, you don't really need to worry about quirks mode unless you're handling older CSS, or older browsers. Just write your CSS to current web standards, and you be OK.

blake
That being said, if you want to support IE6 or 7, you will need to support almost standards mode
Casebash