CSS HACK of IE8 -- 9

web front end seven thousand two hundred and seventy-two 13 years ago (2011-03-12)

People who have followed IE8's css hack believe that everyone is using this hack, which is&ldquo\ 9” Css hack: The code is as follows:

[CODE]. test {color: # 000000;/* FF, OP supports */color: # 0000FF 9;/* All IE browser ( IE6 +) support; However, IE8 does not recognize&ldquo*& rdquo; And&ldquo_& rdquo; Css hack; So we can write hack */[color: # 000000; color: # 00FF00;/* SF, CH supports */* color: # FFFF00;/* IE7 supports */_color: # FF0000;/* IE6 supports */} [/CODE]


  IE6 IE7 IE8 FF OP SA,CH
\0 × × × × ×
\1 × × × × × ×
\2 × × × × × ×
\3 × × × × × ×
\4 × × × × × ×
\5 × × × × × ×
\6 × × × × × ×
\7 × × × × × ×
\8 × × × × × ×
\9 × × ×
\10 × × × × × ×
\11 × × × × × ×
\12 × × × × × ×


Where: OP stands for Opera, SA stands for Safari, and Chrome stands for Chrome; From the above test results, we can see that&ldquo\ 0” The writing method of is only recognized by IE8, but not by ie6 or ie7, then&ldquo\ 0” It should be the real hack of IE8.

CSS hack of mainstream browsers is better:

[CODE]. test {color: # 000000;/* FF, OP supports */color: # 0000FF 0;/* IE8 supports */[color: # 000000; color: # 00FF00;/* SF, CH supports */* color: # FFFF00;/* IE7 supports */_color: # FF0000;/* IE6 supports */} [/CODE]

Where: OP stands for Opera, SA stands for Safari, and Chrome stands for Chrome; In addition, with the popularity of Google Chrome and Safari browsers, there are many people looking for Google Chrome and Safari CSS hacks. I also looked for:

[CODE] body:nth-of-type(1) . CH {color: # FF0000;/* This is a CSS hack for Chrome and Safari */} [/CODE]