简体   繁体   中英

IE vs Chrome quirks mode

If I understand IE document modes correctly:

  • quirks mode:

uses HTML + css rendering engine of IE version <= 5

  • then we have some XU-compatible-modes:

like ie6,7,8, etc

  • and then standard mode:

which uses the current implementation

(For the sake of simplicity I'm not mentioning semi-standard mode)

But What about Chrome ?
I mean what version quirks mode refers to, it must be those versions when Html + css standards were not yet implemented properly I guess...

Also what about javascript does quirks mode has an impact on javascript implementation ?

Any help is appreciated.

Firstly, no, there is no IE6-compatibility mode. The XU-compatible modes start at IE7 mode.

Now, to answer your question: All the major browsers have implemented quirks mode, and it will be used in cases where the site doesn't provide a DOCTYPE, or uses one that triggers quirks mode.

You can check for quirks mode in any modern browser by checking that document.compatMode === "BackCompat"

However, one of the major problems with quirks mode is that it is not consistent between all browsers. In particular, older versions of IE will render quirks mode pages differently from other browsers.

In addition, IE considers quirks mode to be a compatibility mode for IE5.5. Because of this, it disables most of the browser features that have been implemented in later versions, in order for the page to render as closely as possible to how it would have done in IE5.5. Other browsers do not do this; for them, quirks mode is simply a case of changing some styling defaults ( box-sizing being the main one); they don't disable any features for quirks mode, so they will render quirks mode pages quite differently to IE.

In addition to the above, IE11 is different again from earlier IE versions. IE11 has two separate quirks modes: One is the IE5-compatible mode described above; the other is intended to be compatible with the quirks modes in other browsers. These two modes can be triggered in different ways, but it can be confusing and not always obvious which one you'll get.

For all of these reasons, you should avoid quirks mode. Stick with standards mode, and you will get (reasonably) consistent rendering across all browsers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM