Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS hack for width attribute on IE8 and below [duplicate]

I am trying the following CSS hack for IE8 and below:

 .class {
        background-color: #BFBFBF;
        width: 1154px;
        width: 930px \9;
       }

But this CSS hack is affecting IE9 also.

Could you please help me to apply this width attribute only for IE8 and below?

like image 646
Niranjan Kumar Avatar asked Jan 21 '26 04:01

Niranjan Kumar


1 Answers

The other answers are better answers - you should be using conditional comments. But to answer your question as to why what you're doing isn't working, try

width: 930px\9;

Without the space.

like image 163
psychobunny Avatar answered Jan 23 '26 01:01

psychobunny



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!