<p><!--[if IE]> According to the conditional comment this is Internet Explorer<br /> <![endif]-->
<!--[if IE 5]> According to the conditional comment this is Internet Explorer 5<br /> <![endif]-->
<!--[if IE 5.0]> According to the conditional comment this is Internet Explorer 5.0<br /> <![endif]-->
<!--[if IE 5.5]> According to the conditional comment this is Internet Explorer 5.5<br /> <![endif]-->
<!--[if IE 6]> According to the conditional comment this is Internet Explorer 6<br /> <![endif]-->
<!--[if IE 7]> According to the conditional comment this is Internet Explorer 7<br /> <![endif]--></p>
Taking your detection further
Operators is what CC relies on to determine it course of action. We saw above how one operator, "!", is used to negate the browser version to detect. In fact CC supports a handful of other operators, which we shall list and then explain:
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 |
With the above operators more generic detection of browsers such as IE6+ (which encompasses IE6, IE6.1, IE7, and so on) becomes possible. For example:
<!--[if gte IE 6]> You are using IE 6+ <![endif]-->
No comments:
Post a Comment