Many articles about CSS hack are mentioned in 52css.com.
Csser must master the simplest hack skills about IE6, IE7, and ff.
You can also refer to the following article
Http://www.52css.com/search.asp? Searchcontent = hack
FF Browser
Example source code [www.52css.com]. Test {
Height: 20px;
Background-color: orange;
}
Internet Explorer 7
Example source code [www.52css.com] * + html. Test {/* IE7 */
Height: 20px;
Background-color: blue;
}
Internet Explorer 6
Example source code [www.52css.com] * html. Test {/* IE6 */
Height: 20px;
Background-color: black;
}
The above CSS Code shows that FF is the most obedient browser.
In IE6 and IE7, if you want to use hack, you must add the class tag HTML to the front.
This is a good memory. IE6 adds * HTML, while IE7 adds * + HTML, which implies adding a version.
The advantage of CSS hack for class and ID is that it is easy for management and other personnel to accept without taking into account the order,
You can also use this hack to implement version control similar to the JS browser.
After reading the above content, you can click the following effect to see the effect in different browsers,
Orange indicates ff, blue indicates IE7, and black indicates IE6.
Compatible browser versions: ie5.0, ie5.5, ie6.0, ie7.0, firefox1.5, and firefox2.0
Example source code [www.52css.com] # test {
Width: 300px;
Height: 100px;
Background: # DDD! Important;/* FF */
Background: # ff0;/* ie5.0 */
}
# Test/* ie5.5 + */{
* + Background: # c0f! Important;/* ie7.0 */
* Background: # f00;/* ie6.0 */
* Background/* ie5.5 */: # f90;
}
You can test it on your own!