Utilizing conditional comments is essential for any designer/developer attempting to make their clients’ sites cross-browser compatible.
The First Step To Cross Browser Compatability
Using conditional comments allows you to target a specific web browser so that you can apply specific styles. Since certain web browsers will display a site differently, especially internet explorer 6 & 7, this is a great tool to use to ensure that your site is compatible with browsers that your visitors are using.
Lets say your browser is not rendering correctly in IE6. To target all users with IE6, you would do something like this between the <head> tags in your document:
Target Internet Explorer 6
<!–[if IE 6]>
Insert internet explorer 6 specific code here.
<![endif]–>
All browsers other than IE6 will completely ignore this command, including IE7 and IE5.
There are some other useful commands that allow you to get all browsers that are greater than or less than the printed version.
Get Versions Less Than IE 6
<!--[if lt IE 6]> All versions less than IE 6 will use this command. <![endif]-->
Get Versions Greater Than Or Equal To IE 7
<!--[if gte IE 7]> All versions greater than or equal to IE 7 will use this command. <![endif]-->
How To Insert CSS
<!--[if IE 6]> <style type="text/css"> #topdropmenu { display: none; } </style> <![endif]-->
This allows you to apply specific styles on with IE6 or any other browser that you choose!


