Different versions of IE use different css (CSS conditional annotation statement usage) _css/html

Source: Internet
Author: User
Introduction to Conditional annotations
The conditional annotation in 1.IE (Conditional comments) has excellent distinguishing ability between IE version and IE non ie, and is a common hack method in Web design.
2. Conditional annotations can only be used for IE5 or above.
3. If you have installed more than one IE, the conditional annotation will be the highest version of IE as the standard.
4. The basic structure of the conditional annotation and the HTML annotation (<!––>) are the same. Browsers other than IE will therefore look at them as normal annotations and ignore them entirely.
5.IE will determine whether the contents of the conditional annotation are parsed as if the normal page content is parsed according to the IF condition.
Second, the conditional annotation attribute
Gt:greater than, select the version above the conditional version, not including the conditional version
Lt:less than, select the following version of the conditional version, not including the conditional version
Gte:greater than or equal, select the version above the conditional version, including the conditional version
Lte:less than or equal, select the following version of the conditional version, including the conditional version
! : Select all versions except the conditional version, regardless of height
1. Css If hack conditional syntax
<!--[if ie]> only IE <! [endif]-->
Only all win systems can be identified with IE

<!--[if IE 5.0]> only IE 5.0 <! [endif]-->
Only IE5.0 can identify

<!--[if GT ie 5.0]> only ie 5.0+ <! [endif]-->
IE5.0 shifting IE5.5 can be identified

<!--[if LT ie 6]> only ie 6-<! [endif]-->
Only IE6 can be recognized

<!--[if GTE ie 6]> only ie 6/+ <! [endif]-->
IE6 and the ie5.x below IE6 can be identified

<!--[if LTE IE 7]> only IE 7/-<! [endif]-->
Only IE7 can be recognized

<!--[if GTE ie 7]> only ie 7/+ <! [endif]-->
IE7 as well as IE6 and ie5.x below IE7 can be identified.

<!--[if IE 8]> only ie 8/-<! [endif]-->
Only IE8 can be recognized

<!--[if IE 9]> only ie 9/-<! [endif]-->
Only IE9 can be recognized

Note: After if add LT GTE have different effects (participate in other parameters in the same vein)
<!–[if IE 8]> = IE8 only IE8 recognizable
<!–[if lt IE 8]> = IE7 or lower version
<!–[if GTE IE 8]> = above or equal to IE8 version
The following code is a conditional comment that runs in non-IE browsers
<!--[if! ie]><!-->
You are not using Internet Explorer
<!--<! [endif]-->
<!--[if IE 6]><!-->
You are using Internet Explorer version 6 or a non-IE browser
<!--<! [endif]-->
Copy Code code as follows:

<! DOCTYPE html>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>div If condition instance </title>
<body>
You are using:
<!--[if IE 7]>
<! [endif]-->
<!--[if IE 6]>
<! [endif]-->
<!--[if IE 8]>
<! [endif]-->

<!--[if IE 9]>
<! [endif]-->
<br><br>
<strong> Description </strong&gt: If your browser version of how much will show ie how much, for IE6-IE9 experiment </body>
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.