How can I determine the IE browser version with CSS?

Source: Internet
Author: User

Previously, only for all IE browsers:

<!--[if IE]>   <link href="Style/IE.css" rel="stylesheet" type="text/css" /> <![endif]-->

To avoid IE8, you must:

<!--[if lt IE 8]>   <link href="Style/IE.css" rel="stylesheet" type="text/css" /> <![endif]-->

Lt is less than used here, that is, versions earlier than IE8 can be identified.

Or:

<!--[if lte IE 7]>   <link href="Style/IE.css" rel="stylesheet" type="text/css" /> <![endif]-->

Lte is less than and equal to, that is, it can be identified by Versions earlier than and equal to IE7.

Or:

<!--[if !(IE 8)]>   <link href="Style/IE.css" rel="stylesheet" type="text/css" /> <![endif]-->

<! -[If! (IE 8)]> <! [Endif]-> avoid IE8 separately.

I found the following code on the Internet and tested several non-conformities:

1. <! -- [If! IE]> <! --> All except IE can be recognized <! -- <! [Endif] --> 2. <! -- [If IE]> all IE identifiable <! [Endif] --> 3. <! -- [If IE 5.0]> only IE5.0 can recognize <! [Endif] --> 4. <! -- [If IE 5]> only IE5.0 and IE5.5 can be recognized <! [Endif] --> 5. <! -- [If gt IE 5.0]> both IE5.0 and IE5.0 can be recognized <! [Endif] --> 6. <! -- [If IE 6]> only IE6 can recognize <! [Endif] --> 7. <! -- [If lt IE 6]> versions earlier than IE6 and IE6 are recognizable <! [Endif] --> 8. <! -- [If gte IE 6]> IE6 and IE6 and later versions can be recognized <! [Endif] --> 9. <! -- [If IE 7]> only IE7 is recognizable <! [Endif] --> 10. <! -- [If lt IE 7]> versions earlier than IE7 and IE7 are recognizable <! [Endif] --> 11. <! -- [If gte IE 7]> IE7 and IE7 versions can be identified <! [Endif] -->

After testing:

5. <! -- [If gt IE 5.0]> both IE5.0 and IE5.0 can be recognized <! [Endif] -->

Only IE6 or later versions can be identified, that is, IE5.0 is not included.

7. <! -- [If lt IE 6]> versions earlier than IE6 and IE6 are recognizable <! [Endif] -->

Only versions earlier than IE5 can be identified, that is, IE6 is not included.

10. <! -- [If lt IE 7]> versions earlier than IE7 and IE7 are recognizable <! [Endif] -->

Only versions earlier than IE6 can be identified, that is, IE7 is not included.

Later I found it in classic:

Gt = Great Then greater than & gt ;=> greater than <Less than Then Less than & lt ;=< Less than gte = Great Then or Equal greater than or Equal to lte = Less Then or Equal Less than or Equal

I can see it in a bit, and it's a great deal of effort.

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.