Because the IE to!important recognition exists bug, and now most of the Web page standard designer through this bug to compatible with IE and FF, but ie7.0 this bug to fix, so the problem arises again, how compatible with ie.7.0 and can be compatible with ie6.0 and FF? There are policies, there are countermeasures ", foreign web standards designers by using CSS Filter method (not CSS hack) to compatible with ie7.0,ie6.0 and FF, the following is my translation from foreign sites.
Create a new CSS style as follows:
#item {
width:200px;
height:200px;
background:red;
}
Create a new div and use the style of the CSS that you defined earlier:
<div id= "Item" >some text here</div>
Add the lang attribute to the body expression, in Chinese en:
<body lang= "en" >
Now define a style for the DIV element:
*:lang (en) #item {
Background:green!important;
}
This is done in order to overwrite the original CSS style with!important, because: lang selector ie7.0 does not support, so this sentence will not have any effect, so also achieved the same effect ie6.0, but unfortunately, Safari also does not support this property, So you need to add the following CSS styles:
#item: Empty {
Background:green!important
}
: The empty selector is a CSS3 specification, and although Safari does not support this specification, it will still be selected, whether or not this element exists, and now Green will now be tested in browsers other than IE versions and under the following browsers and operating systems:
IE7 Beta 2 Preview/win
Ie5.01+/win
Firefox 1.5/win
Opera 8.5/win & Linux
Netscape 7.01, 8/win
Mozilla 1.7.12/win & Linux
Safari 2/mac
Firefox 1.0.4/linux
Epiphany 1.4.8/linux
Galeon 1.3.20/linux
According to the far author's argument, this is not a hack, it should belong to the filter, but this does not seem to be the most important, because through this approach, we have once again resolved the compatibility between ie6.0,ie7.0 and other browsers, and use: Lang-filter this approach, will be useful for some time to come.