views:

377

answers:

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?

+2  A: 

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 Cuadra
+1 for pointing out other version then IE6 :D
Adam Kiss
+1  A: 

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
I see it even in IETester.
Adam Kiss
True. Must have been a phenomenon in an older version.
Pekka
A: 

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