The official version of IE8 has a piece of log, but there are few CSS hack for the official version of IE8. In fact, this is fortunate because IE8 has fixed many bugs in IE6 and IE7, closer to W3C standards.
CSS hack for the official IE8 version can be found in two types:
First: "\ 9 ″:
Basic statement:
. Test {color/* \ **/: Blue \ 9}
IE6, IE7, and IE8 can both be identified. However, IE8 cannot recognize CSS hack of "*" and "_". Therefore, we can write hack as follows:
. Header {width: 300px;}/* all browsers */
. Header {width/* \ **/: 330px \ 9;}/* all IE browsers */
. Header {* width: 310px;}/* IE7 and IE6 can be identified, and IE8 and FF cannot be recognized */
. Header {_ width: 290px;}/* IE6 can be recognized, and IE7, IE8, and FF cannot be recognized */
The second method is to use the conditional annotation of IE.
For details, see here: Explanation of IE condition annotations;
Other CSS hack tests:
. Color1 {color: # f00; color/* \ **/: # 00f/* \ **/}/* IE6, IE7, IE8, FF, op, sa recognition */
. Color2 {color: # f00; color/* \ **/: # 00f/* \ 9 **/}/* IE7, IE8, FF, op, sa recognition */
. Color3 {color: # f00; color/* \ **/: # 00f \ 9}/* IE6, IE7, IE8 recognition */
. Color4 {color: # f00; color/* \ **/: # 00f \ 9}/* IE7, IE8 recognition * // * There is a space between "color" and */
OP indicates opera, sa indicates safari.