CSSer must master the simplest hack skills about IE6, IE7, and FF.
You can also refer to the following article
FF browser
. Test {
Height: 20px;
Background-color: orange;
}
Internet Explorer 7
* + Html. test {/* IE7 */
Height: 20px;
Background-color: blue;
}
Internet Explorer 6
* 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.
You can test it on your own!