CSS hack Summary

Source: Internet
Author: User

Three Forms of CSS Hack: Internal CSS Hack, selector Hack, and CSS condition annotation.

1. Internal hack:

IE6 special hack underline "_", IE6, 7 can recognize "*", "* +", "+", IE8, 9 support "\ 0", "\ 9 ", opera supports "\ 9 ".

   IE6 IE7 IE8 IE9 Chrome Firefox Safari Opera
_ × × × × × × ×
+ × × × × × ×
* × × × × × ×
* + × × × × × ×
\ 0 × × × × × ×
\ 9 × × × × ×
CSS hack TestView Code

 

2. selector hack:

CSS hack selector TestView Code

 

3.

 





The above are several commonly used syntax for judging the IE browser version. Next we will introduce the less-used logical judgment parameters: lte, lt, gte, gt and!
The detailed explanations are as follows:

! : Not equal

<! -- [If gt IE 7]>/if the IE version is later than 7/
<! -- [If lte IE 6]>/if the IE version is less than or equal to 6/
<! -- [If! IE]>/If the browser is not IE/
......
I believe that everyone understands the usage of the conditional annotation. OK. Let's take an example:
<! -- First use the css.css style sheet -->
<Link rel = "stylesheet" type = "text/css" href = "css.css"/>
<! -- [If! IE]>
<! -- Use the 1.css style sheet for non-ie-based access -->
<Link rel = "stylesheet" type = "text/css" href = "1.css"/>
<! [Endif] -->
<! -- [If lt IE 6]>
<! -- If the IE browser is less than 6, use the 2.css style sheet -->
<Link rel = "stylesheet" type = "text/css" href = "2.css"/>
<! [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.