How To Create an Stylesheet only for Internet Explorer (IE)

Spread the love

How To Create an Stylesheet only for Internet Explorer (IE)

if you are tired of designing issue that you face in IE then this post can help you a lot.Today i am gonna tell you how to use conditional stylesheet that only works for Internet Explorer Only.And yes we will also use IE version based Stylesheets mean you can use a stylesheet only for a specific version.Before we start you must know

why use these conditional stylesheets ?

  • You got problems, they need fixin’
  • Keeps your code hack-free and valid
  • Keeps your main stylesheet clean
  • Perfectly acceptable technique, sanctioned by Microsoft

And remember, these conditional tags don’t have to be used only for CSS. You could load JavaScript, or even use them down in the content of your site to display special IE-specific messages.

How to code

This would go in your head with all the other regular CSS link ed CSS files. The opening and closing tags should be familiar, that’s just regular ol’ HTML comments. Then between the brackets, “IF” and “IE” should be fairly obvious. The syntax to note is “!” stand for “not”, so !IE means “not IE”. gt means “greater than”, gte means “greater than or equal”, lt means “less than”, lte means “less than or equal.”

Note that IE 10 and up DO NOT support conditional comments at all.


Target everything EXCEPT IE

Target IE 7 ONLY

Target IE 6 ONLY

Target IE 5 ONLY

Target IE 5.5 ONLY

Target IE 6 and LOWER

Target IE 7 and LOWER

Target IE 8 and LOWER

Target IE 6 and HIGHER

Target IE 7 and HIGHER

Target IE 8 and HIGHER

Hope it will Help You and please subscribe me and like my facebook page :

and make me proud.By the way if you face any problem then let me know in comment section below

Leave a Reply

Your email address will not be published. Required fields are marked *