Conditional Comments for IE

In a recent post, I pleaded for help with CSS.  Among some of the great suggestions, I stumbled across an interesting feature supported by IE... Conditional Comments. These are evaluated on the client-side. In the context of CSS, it would enable a developer to allow IE to determine whether or not to process a link tag.

Here are some simple examples (not related to CSS):

<!--[if IE 5]><p>You are using Internet Explorer v.5</p><![endif]-->

<!--[if IE 6]><p>You are using Internet Explorer v.6</p><![endif]-->

<![if !IE]><p>Your browser is either old or not IE</p><![endif]>

Observe the lack of <!-- in the last example.  This means the browser will "reveal" the inner content if it is either downlevel or not IE.

No Comments