Full Page History:

Oldest known version of this page was edited on 2005-10-08 14:43:48 by Jakub81 [revert]

Page view:

Opera Quirks Mode

Presto, the new rendering engine from Opera, has created a quirks mode to 'emulate' buggy rendering of pages common among older browsing software. This is triggered by the DocType of the HTML page.

The final version of Opera has followed an IE-bug in that if you have anything other than <DOCTYPE...> on the first line of your page (e.g. you have a standards-compliant <xml...> declaration) then the browser uses quirks mode. This will change in future releases. This has been fixed in Opera V7.1

off = quirks mode / on = standards mode
Label Definition with URL without URL
Label Definition with URL without URL
No !DOCTYPE   Off Off
HTML (No Version)   Off Off
HTML 2.0   Off Off
HTML 3.0   Off Off
HTML 3.2   Off Off
HTML 4.0 No Definition On On
HTML 4.0 Frameset On Off
HTML 4.0 Transitional On Off
HTML 4.0 Strict On On
XHTML All On On
XML   On On
Unrecognized !DOCTYPE   On On
       

To test whether Opera is in quirks or standard rendering mode, type the following into the address bar (or make it a bookmark):

javascript:alert(document.compatMode);

You should get an alertbox with the string "BackCompat" or "QuirksMode" if OperaQuirksMode is in effect, and "CSS1Compat" if Standards mode is in effect.

Note that the DOCTYPE switch only applies to HTML: XHTML pages served with the MimeTypes? "application/xhtml+xml", "application/xml", or "text/xml" will always be rendered in Standards mode, even if no DOCTYPE is used. There is an unofficial MimeType "text/xhtml" -- If a page is served with this MimeType, it must have a valid DOCTYPE for it to be rendered in Standards mode.

There *is* a DOCTYPE switch override in Opera 7.0, note however it is currently buggy (e.g. trying a standards override with NO DocType will still yield Quirks mode etc.)
Put this in your Opera6.ini under [User Prefs]:

CompatMode Override

If set to either 1 or 2 the switching mechanism is overridden as follows:

  1. - Always Quirks Mode
  2. - Always Standards Mode

Behaviours known to be exhibited in Quirks mode:

Behaviours that should change in Quirks mode:

References

Categories

CategoryOpera
CategoryTechnical

Backlinks