HTML condition comments and html comments

Source: Internet
Author: User

HTML condition comments and html comments
Previous

IE condition annotation is a non-standard logical statement provided by Microsoft since IE5. It allows you to flexibly import different html elements to browsers of different IE versions. Obviously, the biggest benefit of this method lies in the compatibility solution officially provided by Microsoft and the W3C validation.

 

Identify IE

Since IE10, ie does not support conditional annotations. Therefore, the following statement can only identify IE9-Browsers

[Note] there must be no space between the two -- and the left braces [; otherwise, it is invalid.

<! -- [If IE]> <div class = "box" id = "box"> </div> <! [Endif] -->

 

Identify a single IE
6 [if IE 6] 7 [if IE 7] 8 [if IE 8] 9 [if IE 9]
<! -- [If IE 7]> <div class = "box" id = "box"> </div> <! [Endif] -->

 

Recognition range: IE
Gt greater than or equal to gte lt less than or equal to lte
<! -- [If lte IE 7]> <div class = "box" id = "box"> </div> <! [Endif] -->

 

Identify non-IE

Actually, it recognizes IE10 + browsers and other non-ie browsers.

<! -- [If! IE]> <div class = "box" id = "box"> </div> <! [Endif] -->

Related Article

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.