I wrote about using condition comments to deal with the styling differences between across browsers. Nikhil Kothari suggests another method:
The trick is to programmatically set the class attribute on the HTML tag based on the browser, and you're done. This is obviously where a little bit of javascript comes into play to do detect the browser along with its version and programmatically set the class value as appropriate.
The css would then look like:
div#foo {
background-color: red;
}
HTML.IE div#foo {
background-color: yellow;
}
HTML.IE7 div#foo {
background-color: blue;
}
While its good to know this approach, I would still prefer using IE conditional comments since it just seem clearer to me. There is a main css for Firefox and separate css files for IE6 and IE7 that only contain the css to address the css differences.