Article introduction of Wulin.com (www.vevb.com): Progressively enhanced version of html.
<!DOCTYPE HTML> <!--[if !IE]><!--><html lang=zh-cn><!--<![endif]--> <!--[if gt IE 9]><html class=ie10 lang=zh-cn><![endif]--> <!--[if IE 9]><html class=ie9 lte9 lang=zh-cn><![endif]--> <!--[if IE 9]><html class=ie9 lte9 lang=zh-cn><![endif]--> <!--[if IE 8]><html class=ie8 lte9 no-css3 lang=zh-cn><![endif]--> <!--[if IE 7]><html class=ie7 lte9 lte7 no-css3 lang=zh-cn><![endif]--> <!--[if lte IE 6]><html class=ie6 lte9 lte7 no-css3 lang=zh-cn><![endif]--> <head> <meta charset=UTF-8> <title></title> </head> <body> </body> </html>There are actually several different versions of this, and it depends on your personal needs. I have also used different versions at different stages and finally confirmed it as this version. Among them, .no-css3 is used to indicate that ie6-8 does not support css3. For gradual addition, advanced browsers can use css3, and ie6-8 uses .no-css3 class to locate the background image. For the triangles generated by ie8 supported by :before and :after, .lt7 can be used to represent the background image of ie7 and ie6.
Updated again, considering that there are still many ie6 browsers in China, I arranged the order and then only made judgments for non-ie6, 7, 8.
<!DOCTYPE HTML> <!--[if lte IE 6]><html class=ie6 lte7 no-css3 lang=zh-cn><![endif]--> <!--[if IE 8]><html class=ie8 no-css3 lang=zh-cn><![endif]--> <!--[if IE 7]><html class=ie7 lte7 no-css3 lang=zh-cn><![endif]--> <!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!--><html lang=zh-cn><!--<![endif]--> <head> <meta charset=UTF-8> <title></title> </head> <body> </body> </html>Add ie9, change no-css3 class to lte8
<!DOCTYPE HTML> <!--[if IE 6]><html class=ie6 lte9 lte8 lte7 lang=zh-cn><![endif]--> <!--[if IE 8]><html class=ie8 lte9 lte8 lang=zh-cn><![endif]--> <!--[if IE 9]><html class=ie9 lte9 lang=zh-cn><![endif]--> <!--[if IE 7]><html class=ie7 lte9 lte8 lte7 lang=zh-cn><![endif]--> <!--[if !(IE 6) | !(IE 7) | !(IE 8) | !(IE 9) ]><!--><html lang=zh-cn><!--<![endif]--> <head> <meta charset=UTF-8> <title></title> </head> <body> </body> </html>