CSS supports Firefox, IE6, and IE7

Source: Internet
Author: User

CodeExample:

# BG {Background: # CCC; filter: alpha (opacity = 70); opacity: 0.7; width: 100%! Important; width: 180%; position: absolute; left: 0px; top: 0px; display: none; Z-index: 1 ;}
* + Html # BG {width: 180%! Important;/* IE7 */}
In the supported sequence of CSS adjustment, Firefox-> IE6-> IE7
1. Firefox is supported first
In Firefox! The important attribute has the highest priority (IE6 and IE7 cannot be recognized ).
Therefore, in the code snippet above, the width parameter recognized by Firefox is width: 100%.
2. ie support
2.1 cannot be parsed in IE6! Important attribute, so IE6 will discard this setting and parse the following width: 180%
Therefore, in the preceding code snippet, the width parameter recognized by IE6 is set to width: 180%.
2.2 cannot be parsed in IE7! Important attribute, so IE7 will discard this setting and parse the following width: 180%, and then there will be a unique * + HTML of IE7 (the element property will keep up with it after it ends! Important, that is, when * + HTML and! When important is used at the same time, it is unique to IE7), so the width: 180% configured later will overwrite the previously set width: 180%
Therefore, in the preceding code snippet, the width parameter recognized by IE7 is set to width: 180%.

 

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.