CSS Hack: Targeting Internet Explorer 2
Another approach that improves readability is to use conditional comments.
Press Ctrl + U to view the page source code and see what's hidden in the blank space on the right.
Conditional comments were provided by Microsoft, but not because of foresight. They were a way to deal with IE's non‑standard rendering.
Actually, it seems that IE10 and later versions no longer support conditional comments; I can see the message "You can view this in any browser except Internet Explorer" in IE11.
|
You can view this in any browser except Internet Explorer.
<!--[if !IE]><!--> Recognized by all browsers except IE <!--<![endif]-->
<!--[if IE]> Recognized by all versions of IE <![endif]-->
<!--[if IE 6]> Recognized only by IE6 <![endif]-->
<!--[if lt IE 6]> Recognized by IE6 and earlier versions <![endif]-->
<!--[if gte IE 6]> Recognized by IE6 and later versions <![endif]-->
<!--[if IE 7]> Recognized only by IE7 <![endif]-->
<!--[if lt IE 7]> Recognized by IE7 and earlier versions <![endif]-->
<!--[if gte IE 7]> Recognized by IE7 and later versions <![endif]-->
<!--[if IE 8]> Recognized only by IE8 <![endif]-->
<!--[if IE 9]> Recognized only by IE9 <![endif]-->
|