div CSS Browser compatibility: Browser CSS Compatible

Source: Internet
Author: User

div {
background-color:red\0; /* IE 8/9*/
background-color:blue\9\0; /* IE 9*/
*background-color:green; /* IE 7*/
_background-color:gray; /* IE 6*/
}
Note the order in which the Csshack is written:
1.BACKGROUND-COLOR:RED\0;IE8 and IE9 are all supported;
2.background-color:blue\9\0; only IE9 support;
(1) Distinction FF (IE8) and IE6 IE7
Backgorund:orange; FF and IE8 background colors will be orange
*backgorund:red; IE6 and IE7 background colors will be red
(2) Distinguishing FF (IE8) with IE6 and IE7
Background:orange; FF and IE8 background colors will be orange
*background:red!important; IE7 background color will be red
*background:blue; IE6 background color will be blue
(3) Distinguishing FF (IE8) with IE6 and IE7
Background:orange; FF and IE8 background colors will be orange
*background:red; IE7 background color will be red
_background:blue; IE6 background color will be blue
(4) Distinguishing ff from IE6 IE7 IE8 IE9
Color:gray; FF and other non-IE browser font color will be gray
color:red\9; IE8 IE9 font color will be red
*color:green; IE7 font color will be green
_color:blue; IE6 font color will be blue
Hint: CSS hack writing order: first write FF and other non-IE browser required style, followed by the IE8/9 required style, followed by the IE7, and then IE6!
Summary: In practical use I feel less used to!important, as long as you remember "*" and "_" I think it is enough to distinguish between FF (IE8) and IE6 and IE7.

This article links http://www.cxybl.com/html/wyzz/CSS/20130622/38769.html

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.