hi a i am triyng to using conditional css like this in my style sheet
div.box {
width: 400px;
[if IE 6] width: 600px;
padding: 0 100px;
}
i want to set a different width to my div in ie6 , so i am trying this code and not working , how can i set a different width in ie6
also i tried this in my style sheet
[if IE]
div.box {
width: 600px;
padding: 0 100px;
}
[endif]
Conditional comments are for use inside HTML documents, not inside CSS files. IE’s HTML parser will interpret the rule inside the comment – as far as I know, there’s no equivalent logic in its CSS parser.
The following code will work:
In most cases, it’s better to use the conditional comment to include an external stylesheet, rather than just wrapping a block of inline styles, like so:
Edited to specify IE6 only as requested in the question.