Skip to content Skip to sidebar Skip to footer

Apply Css Styles Only To Ie9

im my website i have a file (ie.css) to correct css problems of the ie. However, now i have a litte problem. Some default styles of the website are good on ie8 and not on ie9. So,

Solution 1:

What you're looking for is conditional comments:

<!--[if IE 9]>
<style type="text/css">
  IE specific CSS rules go here
</style>
<![endif]-->

Solution 2:

The best way to do this is to set a body class only for IE9 and when you want to modify your css it will begin wit that class in front any other html tag or class. This will guarantee that your css is w3c compliant.

Here's the code for that:

<!--[if IE 9 ]>    <body class="ie9"> <![endif]-->

Solution 3:

Use IE conditional comments:

<!-- [if ie 9]>
 CSS that you want to be IE only
<![endif]>-->

Solution 4:

Try in css like

:root .classname{ color:pink \0/IE9; } /* IE9 */

OR write in head tag

<!--[if IE 9]>
<style>
Special instructions for IE 9 here
</style>

<![endif]-->

Post a Comment for "Apply Css Styles Only To Ie9"