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.

Published Tuesday, November 23, 2004 11:31 AM by Palermo4
Filed under:

Comments

# re: Conditional Comments for IE

Tuesday, November 23, 2004 3:28 PM by timh
yes, take a look at http://dean.edwards.name/IE7/ as well for more of these types of things.

this guy basically has a library of css/javascript that allege to bring ie6 to the "correct" css standard implementation

Leave a Comment

(required) 
(required) 
(optional)
(required)