Conditional Comments
About the Author
Mike Rogers is a Web Developer who is currently at University studying Web Technologies. He also is the founder of Full On Design. He has several years experience freelancing and you can follow him on Twitter (Rogem002).
Most coders and designers will tell you Internet Explorer (Especially IE6 below) is a pain to work with, but I tend to disagree. What most people forget is that even though IE is full of bugs and oddities everything can be fixed, with just a few lines of code.
How to use Conditional Comments
Conditional Comments let you execute sections of code in just IE, so you can import custom CSS sheets (to deal with IE’s weird rendering engine) or special JavaScript; here is how to use conditional comments:
<!--[if IE]> This will only show for Internet Explorer (IE) <![endif]--> <!--[if !IE]> This will only show if the client is not using IE. <!--[endif]> <![if IE 6]--> Only shows on IE6 <!--[endif]> <![if lte IE 6]--> Any IE browser less than or equal to version 6. <!--[endif]> <![if gte IE 7]--> Any IE browser higher or equal to IE 7 <!--[endif]>
Just place snippets of the above code anywhere in your code. If you want more information conditional commenting take a look at the Conditional Comment Wikipedia page.