Condition comment judgment browser & lt ;! -- [If! IE] & gt;, comment if

Source: Internet
Author: User

Condition comment judgment browser <! -- [If! IE]>, comment out if

<! -- [If! IE]> <! --> All except IE can be recognized <! -- <! [Endif] -->
<! -- [If IE]> all IE identifiable <! [Endif] -->
<! -- [If IE 6]> only IE6 can recognize <! [Endif] -->
<! -- [If lt IE 6]> versions earlier than IE6 and IE6 are recognizable <! [Endif] -->
<! -- [If gte IE 6]> IE6 and IE6 and later versions can be recognized <! [Endif] -->
<! -- [If IE 7]> only IE7 is recognizable <! [Endif] -->
<! -- [If lt IE 7]> versions earlier than IE7 and IE7 are recognizable <! [Endif] -->
<! -- [If gte IE 7]> IE7 and IE7 versions can be identified <! [Endif] -->
<! -- [If IE 8]> only IE8 is recognizable <! [Endif] -->
<! -- [If IE 9]> only IE9 can recognize <! [Endif] -->


How to distinguish IE from non-IE in html condition annotations

<! -- [If! IE]>
....
<! [Endif] -->

The HTML annotation format is that IE has made some extensions to HTML annotations so that it can support conditional judgment expressions. How can I make static HTML code

Similar to programming languages, the expressions here also support operators such as greater than (gt), less than (lt), and non-equal operators, conditional annotation is a unique extension of annotation in IE5.0 and later versions. It is not supported by other browsers. [If IE] determines whether IE [if IE 7] Is IE7 [if! IE] determines if it is not IE [if lt IE 5.5] and whether it is IE5.5 or earlier. (<) [If lte IE 6] determine whether it is equal to IE6 or earlier (<=) [if gt IE 5] determine whether it is IE5 or later (>) [if gte IE 7] determine whether IE7 or later [if! (IE 7)] Judging whether it is IE7 [if (gt IE 5) & (lt IE 7)] Judging whether it is greater than IE5, less than IE7 [if (IE 6) | (IE 7)] Judging whether IE6 or IE7 is a comprehensive example code for judging the IE version: <! -- [If IE]> You are using Internet Explorer. <! [Endif] --> <! -- [If! IE] --> You are not using Internet Explorer. <! -- [Endif] --> <! -- [If IE 7]> Welcome to Internet Explorer 7! <! [Endif] --> <! -- [If! (IE 7)]> You are not using version 7. <! [Endif] --> <! -- [If gte IE 7]> You are using IE 7 or greater. <! [Endif] --> <! -- [If (IE 5)]> You are using IE 5 (any version). <! [Endif] --> <! -- [If (gte IE 5.5) & (lt IE 7)]> You are using IE 5.5 or IE 6. <! [Endif] --> <! -- [If lt Internet Explorer 5.5]> Please upgrade your version of Internet Explorer. <! [Endif] --> for <! -[If expression]> HTML <! [Endif]->, non-IE browsers will be treated as comments, not displayed; For <! -[If expression]-> HTML <! -[Endif]->: Non-IE browsers are displayed as common code segments.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.