Quirks Mode is a mode of operation of web browsers such as Internet Explorer (IE), Firefox, and Opera. Basically, Quirks Mode (also called Compatibility Mode) means that a relatively modern browser in-ten-tio-nal-ly simulates many bugs in older brows-ers, es-pe-cial-ly IE 4 and IE 5. Quirks Mode is triggered by
doctype sniffing, also known as
doctype switching.
This means that the browser inspects the start of an HTML document to
see whether it con-tains a The purpose of Quirks Mode is to make old pages to display as their author in-tend-ed. Old pages may have been written to utilize known features of old browsers or at least to adapt to them. For more in-for-ma-tion about Quirks Mode in general, consult the QuirksMode.org site. There is no authoritative specification of what happens in Quirks Mode. After all, the mode is, by essence, an inten-tional violation of CSS and HTML specifications. However, since authors may need a description of what may actually happen in Quirks Mode, I have com-posed this document. (Browser vendors do not generally document Quirks Mode. There are some descriptions, such as The effects of quirks mode emulation about IE, by Microsoft, but such descriptions cover some aspects only.) If you have an existing page
that seems to work well but lacks
a Before adding
a When creating a a new page, you need not know about
Quirks Mode and should usually not think about it. Simply write ac-cord-ing
to HTML and CSS specifications; this includes using
a But if you decide to use some features that might only
work in Quirks Mode, such as a In Quirks Mode, browsers have been observed to behave in the following
ways, though not all browsers exhibit all of these features:
The list is most probably not exhaustive. It relates mainly to IE 7. Other browsers may have a Quirks Mode that does simulate old versions of IE to the same extent. Simple demoThe following simple images demonstrate one of the
many differences between Quirks Mode and Standards Mode on
Internet Explorer,
namely the box model.
They are presentations of the following markup in the
two modes: (Quirks Mode)
(Standards Mode)
Here is the element as presented by your current browser, for a quick check: stuff
The explanation is that in Quirks Mode, the On Firefox, the correct box model is applied in both modes. However, you can still simulate the incorrect box model used by IE in Quirks Model, by using the command CSS/Use Border Box Model in Web Developer Extension (which is a great tool in any CSS-related issue). An IE bug triggered end tag omission in “Standards Mode”A paragraph with no end tag Rendering on IE 7 in “Standards Mode”: On IE 7,
if a
This bug does not exist in previous versions of IE. Presumably, this bug is connected with the fake “XHTML
orientation” in IE 7. This browser version, despite actually
not supporting XHTML, imposes some XHTML-like restrictions
on (non-XHTML) HTML documents! In XHTML, the end tag In IE 8 and IE 9, this bug still exists, in different manifestations. When viewing the test page in Stan-dards Mode, IE 8 shows a bordered thin yellow stripe as if there were an extra empty form before the real form. IE 9 does the same but displays the real form without background color and without border. The conclusion is that the old recommendation to use explicit end tags is very sound. Throughout the history of HTML, various browsers have failed to infer the closing tags properly, and there is probably no end to this madness. Checking the modeTo check which mode (Quirks vs. Standards) a browser is in,
IE 8 “compatibility mode” is differentIE 8 has a “compatibility mode” icon in its address bar in many situations. The icon appears on the right of the address (URL) of the page being visited and it looks like a torn-down sheet of paper.The meaning and use of this icon, as well as the compatibility mode
selection in the Page menu of IE 8, is obscure.
According to tooltip and help texts,
clicking on the icon toggles between compatibility mode and normal mode.
However, contrary to what we might expect, this is not at all the
same as switching between Quirks Mode and Standards Mode.
Some features of rendering may be affected, but crucial issues
such as box model are unaffected; they are based on the
IE 9: more confusionIE 9 has seven different rendering modes, with different
intermediate modes between Quirks Mode and Standards Mode.
Using a correct |
|