CSS

Conditional Comments

March 26, 2005

Conditional comments only work in Explorer on Windows, and are thus excellently suited to give special instructions meant only for Explorer on Windows. They are supported from Explorer 5 onwards, and it is even possible to distinguish between 5.0, 5.5 and 6.0.

A very good article by Quirksmode.org about conditional commenting for MSIE. Since CSS standards aren’t carried well by he various web browsers, not to mention any names, this comes in quite handy. Sadly only Microsoft supports it, but since they’re the ones not following standards (oh wait, I wasn’t going to mention any names, was I?) it works out well. Simply enclose your style sheet call like so:

<!--&#91;if IE&#93;>
<link rel="stylesheet" href="iestyle.css">
<!&#91;endif&#93;-->

And then make your corrections/tweaks in that file. I would go more in depth on the matter, the link details it better than I could.

Reference

Only registered users can comment.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.