Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between 'quirks mode' and 'compatibility mode' in IE?

I thought they were the same thing except I've just found out they are not!

Using IE8 I can get the same webpage to display in 3 different ways:

  1. Standards mode. The XHTML Strict DOCTYPE is at the top of the webpage.

  2. Same as above except that 'compatibilty mode' is clicked in IE8. Now the webpage is displayed slightly weird.

  3. If I remove the DOCTYPE from the webpage (this forces quirks mode?). Now the webpage is displayed very badly and is not the same as when viewed in 'compatibility mode'. At this point clicking 'compatibilty mode' makes no difference.

like image 599
David Avatar asked Jul 18 '11 09:07

David


People also ask

What is quirks mode in IE?

In quirks mode, layout emulates nonstandard behavior in Navigator 4 and Internet Explorer 5. This is essential in order to support websites that were built before the widespread adoption of web standards. In full standards mode, the behavior is (hopefully) the behavior described by the HTML and CSS specifications.

What does compatibility mode mean IE?

Compatibility View is a feature of Windows Internet Explorer 8 that enables the browser to render a webpage nearly identically to the way that Windows Internet Explorer 7 would render it.

What does IE11 compatibility mode do?

Microsoft Internet Explorer 11 has an option called compatibility mode that allows it to emulate older web browsers. Compatibility mode was introduced as a feature to make the browser backward compatible with older websites.

How do I know if my browser is in quirks mode?

In Firefox and Opera you can determine if your browser is in "quirks mode" by checking page info. Using document. compatMode , will tell you the mode you are in with most browsers.


1 Answers

Quirks mode is basically an IE5 compatibility mode. It is triggered by not having a valid <!DOCTYPE> declaration. The main effect is that it causes the browser to use the IE5 box-model, which means that all your paddings, margins and borders, and anything else which affects the size of a box will be incorrect.

Compatibility mode is an IE7-compatibility mode (IE9 also has an IE8-compatibility mode) which is triggered either by a meta tag specifying that the page should use it, or by the user's browser configuration.

Both can also be specified explicitly in the developer tools window.

Compatiblity mode is occasionally useful for testing (since IE7 doesn't have the developer tools window) and for intranet sites where the company is too cheap to update their code to cope with the newer browser. (but having said that, compatibility mode is not an exact replica of IE7; it has it's own bugs and issues, so for most testing, you're better off sticking with a real copy of IE7)

Quirks mode should never be used. Who in their right mind would want to be compatible with IE5?

like image 108
Spudley Avatar answered Nov 16 '22 04:11

Spudley