Conditional Comments are basically a new set of comment-like tags that IE 5+ supports. These tags look very much like the good old comment tag and in fact are treated as such by all browsers except IE, in which they operate a little more intelligently. Using Conditional Comments, you can selectively “comment out” any portion of your page in a way that only IE interprets the containing content, or the other way around.
This is a good and valid alternative to invalid browser specific CSS hacks we used ealier.
<!--[if IE]>
You are using Internet Explorer.
<![endif]-->
<!--[if IE 5]>
You are using Internet Explorer 5.
<![endif]-->
<!--[if IE 5.0]>
You are using Internet Explorer 5.0.
<![endif]-->
<!--[if IE 5.5]>
You are using Internet Explorer 5.5.
<![endif]-->
<!--[if IE 6]>
You are using Internet Explorer 6.
<![endif]-->
<!--[if IE 7]>
You are using Internet Explorer 7.
<![endif]-->
<!--[if gte IE 5]>
You are using Internet Explorer 5 and up.
<![endif]-->
<!--[if lt IE 6]>
You are using Internet Explorer lower than 6.
<![endif]-->
<!--[if lte IE 5.5]>
You are using Internet Explorer lower or equal to 5.5.
<![endif]-->
<!--[if gt IE 6]>
You are using Internet Explorer greater than 6.
<![endif]-->
<!--[if !IE]>
You are NOT using IE.
<![endif]-->
| Operator syntax | Description |
|---|---|
| ! | The “not” operator. |
| lt | The “less than” operator. |
| lte | The “less than or equal to” operator. |
| gt | The “greater than” operator. |
| gte | The “greater than or equal to” operator. |





Recent Comments