I've created few IE conditional comments where:
IE 8 and below will use .ie8AndBelow
IE 9 will use .ie9
IE 10 and above will not add any class
*Below is my code:
<!DOCTYPE HTML>
<!--[if lte IE 8 ]><html class="ie8AndBelow"><![endif]-->
<!--[if IE 9 ]><html class="ie9"><![endif]-->
<!--[if (gte IE 10)|!(IE)]><!-->
<html>
<!--<![endif]-->
<head>
</head>
....
....
However there is one problem, how do I write a condition that only target the IE browsers (regardless of any version), I would like to add a css call .ieOnly to internet explorer only. The only solution I've got is to link it to another css file but not create an individual class to the html tag itself
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="all-ie-only.css" />
<![endif]-->
I would not recommend this as it's deprecated in newer versions of IE, but if you want to use it, support was only added in IE5 so you could use:
<!--[if gte IE 5 ]><html class="ieOnly"><![endif]-->
This would apply to IE5+ (surely nobody is still using older versions), although support has been dropped so a JavaScript solution might be better. Here's one possible solution: Internet Explorer (IE) version detection in JavaScript