As other suggested, you can use conditional comments in your HTML to make specific CSS for IE, example:
<!--[if lte IE 8]>
<link rel="stylesheet" type="text/css" href="custom-ie.css" />
<![endif]-->
Whereas if IE 8
target ONLY IE 8. if IE
target all of them. if lte IE 8
target IE 8 and lower (lte = Lower Than or Equal).
If your project has jQuery, instead of having more work creating other CSS, you can use jQuery's selector for applying newer selectors on older browsers. For that you do:
h2:nth-child(3), h2.nth-child-3 { /*note the class I added */
/*some styles*/
}
The function to test selector compatibility:
function selectorSupported(selector) {
var support, link, sheet, doc = document,
root = doc.documentElement,
head = root.getElementsByTagName('head')[0],
impl = doc.implementation || {
hasFeature: function() {
return false;
}
},
link = doc.createElement("style");
link.type = 'text/css';
(head || root).insertBefore(link, (head || root).firstChild);
sheet = link.sheet || link.styleSheet;
if (!(sheet && selector)) return false;
support = impl.hasFeature('CSS2', '') ?
function(selector) {
try {
sheet.insertRule(selector + '{ }', 0);
sheet.deleteRule(sheet.cssRules.length - 1);
} catch (e) {
return false;
}
return true;
} : function(selector) {
sheet.cssText = selector + ' { }';
return sheet.cssText.length !== 0 && !(/unknown/i).test(sheet.cssText) && sheet.cssText.indexOf(selector) === 0;
};
return support(selector);
};
With this function, now you can test selectors and do accordingly:
//For browsers without :NTH-CHILD(N) - aka IE7/8
if (!selectorSupported(':nth-child(n)')) {
$('h2:nth-child(3)').addClass('nth-child-3');
}
Other example of test:
//For browsers without :LAST-CHILD - aka IE7/8 too
if (!selectorSupported(':last-child')) {
$('p.last-child').addClass('last-child');
}
But of course, only if you want the javascript approach, to not have to double css.