View Full Version : Different CSS for Different Browsers

10-19-2010, 07:42 PM
Awhile back (four years ago, actually), there was a thread about customizing CSS for different browsers. There was a post in it that went like this:
IE provides a way to do it in HTML, no scripting of any sort required.

<link rel="stylesheet" type="text/css" href="normal.css">
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="IE.css">

Does this work in newer versions of IE, like 7 and 8? Because it doesn't seem to be working for me. And is there a better way to do this?


10-20-2010, 01:08 AM
Yes they do. IE 9 will also support them. Read more on them here (http://www.quirksmode.org/css/condcom.html)

i use this method (http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/) by Paul Irish. It removes the need for an additional HTTP request.

Major Payne
10-20-2010, 10:27 AM
The IE Conditional Comments should be placed as the last of the CSS links and any CSS style tags you may have on the page. If not, the last CSS accessed is used.

Right now, I have seen no need for the Conditional Comments for IE 9 Beta. 7/8 still have bugs so they need to have their own IE only styling.

The solution offered is valid in some cases, but it is 4 years old.