武林網(wǎng)(www.survivalescaperooms.com)文章簡(jiǎn)介:漸進(jìn)增強(qiáng)版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 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>這個(gè)其實(shí)有好幾種不同的版本,按個(gè)人的需求來定吧,本人在不同階段也使用了不同的版本,最終確認(rèn)為這個(gè)版本。其中.no-css3用來表示ie6-8不支持css3的樣式,對(duì)于漸進(jìn)增加方面,可以高級(jí)瀏覽器使用css3,ie6-8使用.no-css3這個(gè)class來定位使用背景圖片,而對(duì)于ie8支持的:before和:after生成的三角,則可以使用.lt7來表示ie7及ie6使用背景圖片。
再次更新下,因?yàn)榭紤]到國內(nèi)瀏覽器還是ie6比較多,所以把順序排列了下,然后只針對(duì)非ie6,7,8進(jìn)行判斷
<!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>添加ie9,把no-css3 class改成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>新聞熱點(diǎn)
疑難解答