An if statement in HTML is detailed

Source: Internet
Author: User

The syntax of the if statement code is very simple, is an if judgment statement to determine the type and version of the browser, using similar <!--[if LTE IE 6]> and <! The [endif]--> syntax structure is included to indicate if the browser is IE and the version number is less than or equal to 6.0. A similar syntax is also:

<!--[If ie]>
This can be seen by anyone using IE browser (all versions).
<! [endif]-->

<!--[if IE 6]>
So IE 6.0 version will be seen, only IE 6.0 version.
<! [endif]-->

<!--[If Lt IE 6]>
In this way, the following version of IE 6.0 will be visible, not including 6.0.
<! [endif]-->

<!--[If LTE IE 6]>
In this way, the following version of IE 6.0 will be visible, including 6.0.
<! [endif]-->

<!--[If LTE IE 8]>
In this way, the following version of IE 8.0 will be visible, including 8.0.
<! [endif]-->

<!--[if GT IE 5]>
So IE more than 5.0 version will be seen, does not contain 5.0
<! [endif]-->

<!--[if GTE IE 5]>
So IE more than 5.0 version will be seen, including 5.0
<! [endif]-->

Description
* Gt:greater than (version number greater than)
* Lt:less than (version number is less than)
* Gte:greater than or equal to (version number greater than or equal)
* lte:less than or equal to (version number is less than equal)

Very useful judgment statement, especially in some Web pages are very particular about IE version of the case judgment is very useful, haha 、、、 thank the original author.

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.