CSS hack of ie9

Source: Internet
Author: User

Div {

Background-color: Red \ 0;/* Internet Explorer 8/9 */

Background-color: Blue \ 9 \ 0;/* ie 9 */

* Background-color: green;/* IE 7 */

_ Background-color: Gray;/* IE 6 */

}

Pay attention to the csshack write order, where:

1. Background-color: Red \ 0; supported by IE8 and ie9;
2. Background-color: Blue \ 9 \ 0; only supported by ie9;

(1) Difference between FF (IE8) and IE6 IE7

Backgorund: orange; FF and IE8 background colors will be orange

* Backgorund: red; the background colors of IE6 and IE7 will be red.

(2) Difference between FF (IE8) and IE6 and IE7

Background: orange; FF and IE8 background colors will be orange

* Background: red! Important; IE7 background color will be red

* Background: Blue; the background color of IE6 is blue.

(3) Difference between FF (IE8) and IE6 and IE7

Background: orange; FF and IE8 background colors will be orange

* Background: red; the background color of IE7 is red.

_ Background: Blue; IE6 background color will be blue

(4) Difference between FF and IE6 IE7 IE8 ie9

Color: gray; FF and other non-IE browser font colors will be gray

Color: Red \ 9; IE8 ie9 font color will be red

* Color: green; The IE7 font color will be green

_ Color: Blue; IE6 font color will be blue

Tip: CSS hack writing sequence: Write the style required by ff and other non-ie browsers, followed by the style required by IE8/9, followed by IE7, followed by IE6!

Conclusion: I feel less useful in practical use! Important, as long as you remember "*" and "_", I think it is enough to distinguish ff (IE8) from IE6 and IE7.

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.