Forum Moderators: not2easy

Message Too Old, No Replies

external css and conditional comments

do conditional comments for IE windows work in external css files

         

vsgill

1:33 am on Jul 15, 2007 (gmt 0)

10+ Year Member



Hello Friends
I am wondering if conditional comments for IE windows work in external css files?

For example ....


.myclass{
width:500px;
<!--[if IE 6]>
width:400px;
}
<![endif]-->

can i put the above code in a css file?

it does not seem to be working for me.:(

Thanks
Vik

encyclo

1:36 am on Jul 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Short answer: no. Longer answer: the conditional comments are SGML (HTML) comments, not valid CSS comments. IE doesn't parse the CSS file for comments.

You can place the main rules in one stylesheet, and then have one conditional comment in the HTML to load a correcting stylesheet for the IE bugs.

vsgill

1:58 am on Jul 15, 2007 (gmt 0)

10+ Year Member



Thanks encyclo