! Important hack method in ie7.0 due to ie pair! Important identifies bugs, and now most web standard designers use this bug to be compatible with ie and ff. However, ie7.0 fixes this bug, so the problem arises again, how can I be compatible with both ie.7.0 and ie6.0 and ff? As the saying goes, "there are policies and countermeasures", foreign webpage standard designers are compatible with ie7.0, ie6.0, and ff by using css filter (not css hack, the following is my translation from a foreign website.
Create a css style as follows:
# Item {
Width: 200px;
Height: 200px;
Background: red;
}
Create a new p and use the css style defined above:
Some text here
Add the lang attribute in the body representation. The Chinese character is zh:
Now define another style for the p element:
*: Lang (en) # item {
Background: green! Important;
}
This is intended for use! Important overwrites the original css style. Because the lang selector ie7.0 does not support this sentence, it does not have any effect on this sentence, so it achieves the same effect in ie6.0, unfortunately, safari does not support this attribute, so you need to add the following css style:
# Item: empty {
Background: green! Important
}
: The empty selector is a css3 specification. Although safari does not support this specification, this element is still selected, whether or not this element exists, now green will now be available in browsers other than ie, and pass the test in 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 author, this is actually not a kind of hack, it should belong to the filter, but it does not seem to be the most important, because through this method, we once again solve IE6.0, compatibility between IE7.0 and other browsers, and the use of: lang-filter will be useful in the future.