Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Page stuck in Quirks Mode

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!

like image 807
Zanrok Avatar asked Feb 23 '23 05:02

Zanrok


2 Answers

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" />
like image 130
thirtydot Avatar answered Feb 25 '23 19:02

thirtydot


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
like image 20
Alex Nolasco Avatar answered Feb 25 '23 17:02

Alex Nolasco