Current mainstream browsers may display an HTML file in either standards mode or quirks mode. This means that different rules are applied to the display of the file, one conforming to the W3C standards interpretation of expected behavior, the other to expectations based on the non-standard behavior of older browsers.
The screen captures below illustrate some of these differences.
| A document rendered in standards mode. | The same document rendered in quirks mode. |
![]() | ![]() |
Differences illustrated above include the following:
In standards mode the width setting in CSS does not incorporate any padding and border settings, whereas in quirks mode it does - which is why the large box is thinner in the second picture.
CSS is used to set the font size quite large for the body tag (and all other elements through inheritance), and reduced by 50% within any p element. In quirks mode the table has not inherited the font size setting from the body element, so the text looks smaller. (Note that the text in the large box is the same size, since this is not in a table, but is in a p element.)
The two pictures show two pages with exactly the same markup and CSS styling. The only difference between the source of the two files is that the one on the left has a DOCTYPE declaration at the top, and the other doesn't. A file with an appropriate DOCTYPE declaration should normally be rendered in standards mode by recent versions of most browsers. No DOCTYPE, and you get quirks.
Browsers that switch in this way between standards and quirks modes are often said to do 'DOCTYPE switching'.
Version: $Id: Slide0180.html,v 1.2 2006/02/02 07:54:31 rishida Exp $