Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why am I triggering quirks mode in IE8?

I'm working on a page that, when I load into IE8 and view the developers tools it tells me that page default is quirks mode.

I've got a strict DTD:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

I even went ahead and put in the explicit standards switch, though I didn't think I'd need to:

<meta http-equiv="X-UA-Compatible" content="IE=8" />

I can't understand why page default isn't IE8 standards?

Only thing I can think of is that to get to this page, I first have to log in to an application and the first pages I must traverse are old quirks mode pages. Does IE decide on which mode to use at a server level, or is it supposed to decide page by page?

Thanks!

like image 883
Tim Sheiner Avatar asked Oct 30 '09 23:10

Tim Sheiner


People also ask

What might possibly happen in quirks mode?

Quirks Mode is a mode of operation of web browsers such as Internet Explorer (IE), Firefox, and Opera. Basically, Quirks Mode (also called Compatibility Mode ) means that a relatively modern browser intentionally simulates many bugs in older browsers, especially IE 4 and IE 5.

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.

What is quirks mode in Google Chrome?

Chrome Quirks is a fun extension that allows you to inject pre-loaded effects or custom CSS onto any webpage you visit. Developers can quickly and easily edit CSS and test ideas out.


1 Answers

Does IE decide on which mode to use at a server level

Not generally, no. There is the ugliness of the compatibility view list, which is site-specific, but that only kicks you back to IE7-style-Standards Mode, not IE5.5-style-Quirks-Mode.

Your code otherwise looks OK, as long as that DOCTYPE is the very first thing on the page. IE will be forced to document.compatMode= 'BackCompat' if there is a comment, PI, XML declaration (prior to IE8) or any non-whitespace textual content before the doctype. If a control character has snuck in that you can't see in your text editor, that could do it.

Example problem page?

like image 125
bobince Avatar answered Nov 09 '22 10:11

bobince