How to write IE specific CSS to the same CSS file.

Sometimes we are facing issue with IE browsers, specially after introduce of CSS3 properties. In that case we need some IE specific css code to be written.
Generally what we are doing, we are writing one separate css file and including the file in header specially for IE like the following code.


Or we are writing some hack to the CSS codes like this.

* html #div { 
    height: 300px;
}

*+html #div { 
    height: 300px;
}
#div {
   _height: 300px;
}
#div {
   height/**/: 300px;
}

But if we will get one separate class name in the body tag specially for IE browser, then we can easily manage the IE specific CSS code to that single CSS file by taking the parent class as the body class. Which will executes only for IE browsers.
The following HTML code will help you to write a separate css class to body specially for IE browsers.



   

Keep Coding enjoy CSS !!!!

Comments

  1. I love what you guys tend to be up too. Such clever work and exposure!
    Keep up the great works guys I’ve added you guys to my blogroll.

  2. Every weekend i used to pay a quick visit this
    website, as i want enjoyment, as this this site conations really fastidious funny information too.

  3. you are truly a excellent webmaster. The web site loading pace is amazing.

    It sort of feels that you are doing any distinctive trick.

    Furthermore, The contents are masterwork. you’ve performed a
    fantastic process on this topic!

Leave a Comment