Quick Tip: How to target IE browsers using conditional stylesheets

Internet Explore (IE) can be very annoying if you’re coding a website in Firefox, Opera, Chrome, or Safari. As you may all know IE has many problems when it comes to designing and creating a website. In this quick tip article I will show you how you can target specific IE browsers using conditional stylesheets. After this all your IE bugs should be taken care of.

Note: Please place the conditional stylesheet code inside the head tags or else they will not work.

The code below Targets every version of Internet Explorer

The code below Targets Internet Explorer 7 Only

The code below Targets Internet Explorer 8 Only

If you wanted to target multiple browsers but not include one you would use the code below. The code below tells whatever browsers your using to target every Internet Explorer from IE7 and down. If you wanted to target IE8 then you would simply change the 7 to 8.

So if you every run across a bug in IE feel free to use one of the conditional stylehseet methods to target and catch those bugs. I hope this tutorial was helpful to you. Now go catch some bugs!

Joe Granados the author

Joe Granados is the owner of WebDevTuts. He is also a web designer & developer who loves to design and develop websites. If you're looking for him you can find him via @webdevtuts
  1. Kent Tan says:

    Great! Thanks for the tip! Actually as of today should we still be bothered with IE6? Also, would you know of any firebug replacement for IE? Sometimes that teeny extra line of whitespace really drives me crazy.

Leave a Reply