Nicholas Wilson wrote:
> ...
> 
> We have to start with:
> 
> <!--[if IE]>
> 
> Now IE thinks we are not in a comment, and the rest do.

Yes

> 
> <!--[if IE]><!-->
> 
> Now IE has started a comment, and <! is ignored by the rest, so they now 
> think 
> they are not in a comment.

In theory, yes.

In fact IE erroneously believes that <!--> is a complete comment.

> 
> You mirror this with the closing tag:
> 
> <!--[if IE]><!-->
> ...seen by everything except IE...
> <!--><![endif]-->


This is not correct. It is seen by everything, including IE.

<!--[if IE]><!--> Do you see me? <!--><![endif]-->

Is currently seen by all browsers including IE due to its comment 
parsing bug.


The IE comment parsing bug can be seen in action here, too.

<!-- 1. must not be visible  -->

<!-->2. must not be visible  -->

<!-->3. must not be visible<!-->

According to the specs, none of these three lines are visible. This code 
is valid HTML. But in all versions of IE including IE8, the second and 
third line are visible.

Stu Nicholls widely uses this comment parsing bug in his menus, but the 
day IE 9 fixes it and "<!-->" is correctly parsed as the beginning of a 
comment only, all these fragile constructs will break:

<!--[if gte IE 7]><!--> </a> <!--<![endif]-->

His idea is to close the link in all browsers except IE6 or less. This 
relies on the bug that <!--> opens and closes a comment in IE7.

Do not use "<!-->", since it will probably change its behavior in future IE.

Ingo

-- 
http://www.satzansatz.de/css.html
http://www.dolphinsback.com
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to