Reputation: 39
How do you activate quirks mode only for IE versions below IE8 on a page where the doctype html5 is set? Or, is possible to interpret a piece of code in quirks mode?
Upvotes: 2
Views: 99
Reputation: 13556
It appears to be possible to achieve this by combining any HTML comment (<!-- anything -->
) before the doctype (this triggers Quirks mode in IE6—9) and <meta http-equiv="X-UA-Compatible"content="IE=Edge">
(which has precedence over the doctype and triggers Standards mode in IE8—9). So only IE6—7 will have Quirks mode, and IE8+ and all non-IE browsers will switch to Standards mode.
Upvotes: 1