3

This is driving me nuts. I'm trying to use a conditional IE6 stylesheet. I posted this test page here. Here is the code I placed in my head tags:

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->

The ie6.css should set the body background to red when viewed in IE6.

What's wrong here? I'm sure it's something dumb. Could someone please point it out to me?

bcWeb
  • 961
  • 1
  • 8
  • 7
  • Works here, it looks fine... If you're having the problem on different page then the one you've shown, check if you have right path there :) – Adam Kiss Feb 07 '10 at 00:09
  • 5
    Why isn't it *not* working? :p – womp Feb 07 '10 at 00:09
  • @womp - you got me there with double negative. – Adam Kiss Feb 07 '10 at 00:15
  • 1
    Why are people surprised it works? The poster himself states that it working? – Dan Diplo Feb 07 '10 at 00:47
  • Very strange. It's still not working when testing on IE6 on my Win XP Asus netbook (running multiple IEs). Tried clearing my cache, same result. But on my mac running VMWare + Win XP + Multiple IEs, it works fine. It must be some wierd issue with my netbook, so the problem seems to be isolated to me. Thanks guys! – bcWeb Feb 08 '10 at 14:54

4 Answers4

2

It works fine for me. Run your test page through IE NetRenderer and you'll see the red background. Perhaps you're testing it in a version of IE other than 6?

Jimmy
  • 35,686
  • 13
  • 80
  • 98
2

You don't happen to be trying this using IETester?

Because with IETester, Conditional Comments will always resolve to the highest installed version of IE.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
0

I just had a similiar issue. The conditional comments did not work correctly and I tried everything. The issue was that I had an X UA compatible meta tag in the header which obviuously influences the rendering. So keep watching out for that because that can be a reason.

<meta http-equiv="X-UA-Compatible" content="IE=7" />
ЯegDwight
  • 24,821
  • 10
  • 45
  • 52
Sam
  • 1
0

is the CSS file in the root folder (same folder as the HTML) ? it's good practice to put your CSS in a separate folder.

<!--[if IE 6]><link href="css/ie6.css" rel="stylesheet" type="text/css" /><![endif]-->
pixeltocode
  • 5,312
  • 11
  • 52
  • 69