Don't be stingy, Share this post with others!
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
<!--[if IE]><link rel="stylesheet" type="text/css" href="IE.css" /><![endif]-->
The code below Targets Internet Explorer 7 Only
<!--[if IE 7]><link rel="stylesheet" type="text/css" href="IE7.css"><![endif]-->
The code below Targets Internet Explorer 8 Only
<!--[if IE 8]><link rel="stylesheet" type="text/css" href="IE7.css"><![endif]-->
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.
<!--[if IE lt 7]><link rel="stylesheet" type="text/css" href="IE7.css"><![endif]-->
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!
Don't be stingy, Share this post with others!
Chrome, conditional stylesheet, conditional stylesheets, conditional stylesheets tutorial, Css, Firefox, how to add conditional stylesheets, IE, ie only stylesheet, Internet Explorer, Opera, quick tip, stylesheet.
6 Responses to Quick Tip: How to target IE browsers using conditional stylesheets
-
-
Thanks Marcell!
-
Actually there are less than 5% users in the U.S. that use IE6 so depending on your audience, consider it dead. For those that won’t upgrade….fuck em.
http://www.electronista.com/articles/10/06/01/old.microsoft.browser.dying.off.amid.rivals/
-
-
Good article. Where can I get some info on what to put in each of these files:
Thanks.
-
Thanks!! useful Information…..
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.