Search code examples
htmlcssconditional-comments

IE9 Is Using Conditional IE7 Stylesheet


I have the following extra stylesheets to deal with some naughty browser behaviour in older versions on Internet Explorer:

    <!--[if IE 8]>
    <link rel="stylesheet" href="/CallCentre/ServiceCloud/Content/IE8.css">
    <![endif]-->
    <!--[if IE 7]>
    <link rel="stylesheet" href="/CallCentre/ServiceCloud/Content/IE7.css">
    <![endif]-->

The problem I have is that a rule that only exists in IE7.css is being applied in Internet Explorer 9.

Why is IE9 using my conditional IE7 stylesheet?

Updated

Oded and hsalama are heading in the right direction.

If I use:

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

Or

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

It loads "Browser Mode: IE9 Compat View".

If I remove this tag is runs in IE7 mode.


Solution

  • This appears to be a bug in the IE Developer Tools. If I run the page on most machines it works as expected and doesn't load the IE7 styles. With Developer Tools open, it seems to jump to IE7 mode in the Developer Tools for some inexplicable reason. The problem only occurs with developer tools open.