Page stuck in Quirks Mode
Asked Answered
W

2

4

Currently the page I am working displays fine in Chrome and Firefox, but in IE9 it is rendering in Quirks mode.

Looking into the issue further, it seems that

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"

is always getting commented out. Causing Quirks mode to stay in place as no doctype is specified. Basically, I am trying to force the page to render in normal IE9 and not quirks mode. However, something is causing the comment out. Regretfully, this is a wordpress theme that's why I am having a hard time fixing the issue as I didn't write the original code.

Anyone have suggestions?

Thank you!

Windflower answered 23/8, 2011 at 22:26 Comment(1)
regretfully I do not as the page is password protected as its in currently in development. Any ideas of what to look for without seeing the page is question?Windflower
K
7

I don't know what you mean by "[the doctype] is always getting commented out".

There are many different things that can cause Quirks Mode, see here.

Another common cause is having stuff before the doctype. Even invisible stuff.

You can fix this without debugging the actual problem if you add this in your <head>:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />
Komsomol answered 24/8, 2011 at 13:36 Comment(5)
Recent versions of IE are known to comment out the doctype line for some bizarre reason.Ekaterina
@BoltClock: Do you have any more info about that?Komsomol
Not sure about sources, but a significant number of people here have run into this problem. I don't know much about it either myself.Ekaterina
Thanks thirtydot. I was able to fix the problem somewhat by using <meta http-equiv="X-UA-Compatible" content="IE=8" /> However, your fix worked perfectly! Thank you!Windflower
But XHTML 1.0 Strict requires the xml header before the doctype! So your answer is a winner, thank you!Redfield
M
1

Also check your IE,

  1. Click on Tools
  2. Compatibility view settings
  3. Be sure your site is not included in the "compatibility view" aka quirks
  4. See also the check boxes
Manno answered 25/7, 2012 at 19:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.