Click to See Complete Forum and Search --> : CSS specificity and IE6 override .css


nnhubbard
01-07-2008, 04:12 PM
I have created a style sheet that is only for IE6, but it seems to be not picked up by IE. Here is how I have it:

<link rel="stylesheet" type="text/css" href="http://websrv.puc.edu/__data/assets/text_file/0012/246/global.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://websrv.puc.edu/__data/assets/text_file/0017/2384/scroller.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://websrv.puc.edu/__data/assets/text_file/0003/2496/home.css" media="screen" />

<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="http://websrv.puc.edu/__data/assets/text_file/0013/11803/ie6.css" media="screen" />
<![endif]-->

If I put the IE styles in a <style> block they work, but why not in an external .css file?

dtm32236
01-07-2008, 08:04 PM
try

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="http://websrv.puc.edu/__data/assets/text_file/0013/11803/ie6.css" media="screen" />
<![endif]-->

i don't know why <!--[if lt IE7> doesn't work though.

nnhubbard
01-08-2008, 09:55 AM
Is my specificity correct though?

dtm32236
01-08-2008, 11:02 AM
it looks correct.. i don't know why it's not working.

WebJoel
01-08-2008, 11:24 AM
... i don't know why <!--[if lt IE7]> doesn't work though... I don't use conditionals much (well, hardly ever), but maybe IE7 is 'correct enough' that it no longer requires conditions(?? Okay, -I don't think that's even possible!)

Maybe try:

<!--[if lt IE 7]>....

-->
Note the 'whitespace' between "IE" and "7"...

I'd rather think that anything 'less than IE7' would be "lte IE6" ("less-than or equal-to" ~)..