1

I've been working on this for a few hours and still no joy. I'm working on IE9.

I have:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

I also have the document mode on IE8 set by:

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

This resultsin IE8 for the document mode (good) but it results in the browser mode automatically going into compatibility mode which mucks the website up.

What do I need to change to stop IE9 defaulting to compatibility mode when loading the page for a visitor?

GSerg
  • 76,472
  • 17
  • 159
  • 346
user1148754
  • 11
  • 1
  • 2
  • http://stackoverflow.com/questions/1722085/ie8-browser-mode-standards-mode – Grumpy Jan 14 '12 at 00:34
  • 1
    possible duplicate of [Why does IE9 switch to compatibility mode on my website?](http://stackoverflow.com/questions/3726357/why-does-ie9-switch-to-compatibility-mode-on-my-website) – PeeHaa Jan 14 '12 at 00:41

2 Answers2

1

If you use a web-server, add X-UA-Compatible: IE=edge HTTP response header instead of the corresponding <meta> tag to switch to latest standards and disable the compatibility mode button.

If your code is standard enough, IE won't switch to compatibility. Run through the validator and JSLint to verify this.

sompylasar
  • 924
  • 11
  • 15
1

Use the meta tag whit this way:

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

IE=EmulateIE7. Specify IE=5, IE=7, IE=8, or IE=9

http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx

Massimo
  • 31
  • 2
  • This does not work as it still puts IE 9 into compatibility mode and the document mode is IE9, which is not what I want. I need IE8. – user1148754 Jan 14 '12 at 10:28