How can I apply the rules below to IE only?

Apply CSS Rules to IE only

There are 2 ways to do so. One like below

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

And second one like to avoid loading multiple CSS files or to have inline CSS is to hand a class to the body tag depending on the version of Internet Explorer.

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

Now in your css code, you can simply do:

.ie .abc {

Leave a comment