Use CSS hack technology to solve browser compatibility problems

Source: Internet
Author: User

/* CSS Attribute-level Hack */color: red;/* all browsers can recognize */_ color: red;/* Only IE6 recognizes */* color: red; /* IE6, IE7 recognition */+ color: red;/* IE6, IE7 recognition */* + color: red;/* IE6, IE7 recognition */[color: red; /* IE6, IE7 recognition */color: red \ 9;/* IE6, IE7, IE8, and IE9 recognition */color: red \ 0; /* IE8 and IE9 recognition */color: red \ 9 \ 0;/* Only IE9 recognition */color: red \ 0;/* Only IE9 recognition */color: red! Important;/* IE6 not recognized! For more information about important, see */strong/* CSS character-level Hack */* html # demo {color: red;}/* Only IE6 recognition */* + html # demo {color: red;}/* Only IE7 recognition */body: nth-of-type (1) # demo {color: red ;} /* IE9 +, FF3.5 +, Chrome, Safari, and Opera can recognize */head: first-child + body # demo {color: red ;} /* IE7 +, FF, Chrome, Safari, and Opera can be recognized */: root # demo {color: red \ 9;}:/* Only IE9 recognition */---------------------- --------------------------------------/* For more information about Hack, see */<! -- [If IE]> the content here is only visible to IE <! [Endif] --> <! -- [If IE 6]> the content here is only visible to IE6.0 <! [Endif] --> <! -- [If IE 7]> the content here is only visible to IE7.0 <! [Endif] --> <! -- [If gte IE 6]> IE6 and IE6 and later versions can be recognized <! [Endif] --> <! -- [If lt IE 7]> versions earlier than IE7 and IE7 are recognizable <! [Endif] --> <! -- [If gte IE 7]> IE7 and IE7 versions can be identified <! [Endif] --> <! -- [If! IE]> the content here is only non-IE visible <! [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.