0

I am trying to add a property and it should apply only when the page opens in IE9. I am using the following css.

 .contents{
        width:5%;
        position: relative;
        display: inline-block;
        text-align:left;
        cursor: pointer;
        margin-right:0.5%;
        padding-right:1%;
        float: left\9;
        padding-top: .5em; 
    }

I want to apply float property for IE 9. But it is using this property both in IE10 and IE9. How to stick this property to IE9?

hanu
  • 397
  • 1
  • 8
  • 20

1 Answers1

0

add the :root psuedo selector and \0/IE9 for the certain style

For instace;

 :root .contents{
        width:5%;
        position: relative;
        display: inline-block;
        text-align:left;
        cursor: pointer;
        margin-right:0.5%;  
        padding-right:1%;
        float: left \0/IE9;   /* IE9 */
        padding-top: .5em; 
    }

Will have the float applied only to IE9

Roysh
  • 1,542
  • 3
  • 16
  • 26
  • I am using .less file to specify css. I used this statement and when I compiled I am getting 'parse error:unrecognised input'.DO i have to change the syntax? – hanu Jun 15 '16 at 15:50