1

I have a website. Its one section looks the way i want in IE9 and in IE8. But when IE9 compatibility mode is selected the look changes. How can i write a hack for that?

Kara
  • 6,115
  • 16
  • 50
  • 57
Engineer
  • 5,911
  • 4
  • 31
  • 58
  • possible duplicate of [How can I programmaticaly disable IE compatibility mode?](http://stackoverflow.com/questions/3803901/how-can-i-programmaticaly-disable-ie-compatibility-mode) – Jon May 30 '13 at 10:12
  • short answer: don't use compatibility mode. – Spudley May 30 '13 at 10:24

1 Answers1

4

Short answer: don't use compatibility mode.

You can force IE not to use compat mode with the following line in the <head> section of your HTML code:

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

Hope that helps.

Spudley
  • 166,037
  • 39
  • 233
  • 307
  • i added this. But still Its breaking in IE 9 compatibility ode! – Engineer May 30 '13 at 11:18
  • this line should normally stop it going into compatibility mode in the first place. – Spudley May 30 '13 at 11:19
  • Yes but it is not stoping! – Engineer May 30 '13 at 11:20
  • okay, there are a couple of IE config settings that might be at work here. Firstly, if the page has HTML errors, it might force IE into compat mode. Check with http://validator.w3.org/ to confirm. Secondly if it's running on your local PC, you might be hitting IE's "compat mode on local intranet sites" setting. If so, you should probably switch that setting off. – Spudley May 30 '13 at 11:30