PDA

View Full Version : IE CSS hack troubles



sixrfan
Sep 22nd, 2009, 05:33 AM
how come the IE 6 specific hack i have in place is also being applied in regular IE 8?

thanks in advance!



<link href="../style_sheets/pt_style.css" rel="stylesheet" type="text/css" />

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

seco
Sep 22nd, 2009, 06:02 AM
cause <!–-[if IE 6]> isnt a hack.

try



<!--[if lte IE 6]>
css link here
<![endif]-->

sixrfan
Sep 22nd, 2009, 03:59 PM
i tried that too. here's what i have now;



<!-[if lte IE 6]>
<link rel="stylesheet" href="../style_sheets/ie.css" type="text/css" media="screen" />
<![endif]->


however, it's effecting IE 8. any idea why???? thanks.

SB65
Sep 22nd, 2009, 04:01 PM
Got a link to your page?

sixrfan
Sep 22nd, 2009, 04:24 PM
PM sent with URL.

actually it gets even more bizarre. apparently its effecting Firefox as well?!

any ideas? thanks!

SB65
Sep 22nd, 2009, 05:04 PM
Weirdest of the day...

It's your if statement: <!-[if lte IE 6]>

If you look closely, the first dash after the exclamation mark isn't a dash - it's another character - so the statement isn't being interpreted as a comment/conditional for IE - so everything including IE8 and Firefox is using the ie.css.

Hard to spot - I pasted into DW and it looked identical to a correctly formatted statement - although DW highlighted it as an error. Had to paste into Word before I could see the difference....

abduraooft
Sep 22nd, 2009, 05:25 PM
If you look closely, the first dash after the exclamation mark isn't a dash - it's another character Brilliant! both you and the OP :)

sixrfan
Sep 22nd, 2009, 07:26 PM
friggin brilliant catch. i would not have spotted that or even known to spot it in a million years. thank you! :thumbsup: