Advantages and disadvantages of conditional comments for IE _ HTML/Xhtml _ web page creation

Source: Internet
Author: User
Conditional annotations of IE are proprietary (and therefore non-standard) Miscrosoft extensions for regular (X) HTML annotations. Conditional annotations of IE are proprietary (and therefore non-standard) Miscrosoft extensions for regular (X) HTML annotations. As the name suggests, conditional annotations enable you to expand Miscrosoft based on conditions (for example, IE conditional annotations are proprietary (and therefore non-standard) and regular (X) HTML annotations.
Conditional annotations of IE are proprietary (and therefore non-standard) Miscrosoft extensions for regular (X) HTML annotations. As the name suggests, conditional comments allow you to display code blocks based on conditions (such as the browser version. Although not standard, conditional comments appear as regular comments for all other browsers, so they are essentially harmless. Conditional comments appear for the first time in IE5 on Windows and are supported by all subsequent versions of the Widnows browser.
Conditional annotations and their validity of IE are easy to remember. The main drawback is that these annotations need to be placed on HTML pages rather than CSS pages. In this way, when you don't need these things or make some changes, you need to maintain a lot of things.
Let's take a look at several examples --
Only IE can recognize
Only IE5 and later versions support IE conditional comments. All "only IE" means "only IE5 and later.

Only specific versions can be identified
For example, only IE5 can be identified, only IE6 can be identified, and only IE7 or IE8 can be identified. The recognition condition is a specific version, which is neither high nor low. For example, the following code block will only be valid in IE8.


Only versions that are not specific can be identified.
Of course, the IE browser must be in version 5 or above to be discussed. For example, in the following example, IE7 is not recognizable.

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.