鍦ㄤ笂涓€绡囨枃绔?a href="http://www.cnblogs.com/JustinYoung/archive/2009/03/24/kaifarenyuangongju.html" target="_blank">IE8鈥滃紑鍙戜汉鍛樺伐鍏封€濅娇鐢ㄨ瑙d笂(鍚勭骇鑿滃崟璇﹁В)涓紝鎴戜滑璇︾粏鍦拌瑙d簡IE8寮€鍙戜汉鍛樺伐鍏蜂腑鍚勪釜鑿滃崟涓懡浠ょ殑浣跨敤鏂规硶锛岀浉淇″緢澶氭湅鍙嬪簲璇ュ凡缁忎娇鐢ㄤ笂浜嗐€傝€孖E8寮€鍙戜汉鍛樺伐鍏锋洿寮哄姴鐨勫姛鑳戒緥濡傦細濡備綍娴嬭瘯鐗堟湰鍏煎鎬с€佸浣曞埄鐢ㄥ紑鍙戜汉鍛樺伐鍏疯皟璇旿avaScript鑴氭湰锛屼互鍙婂浣曞埄鐢ㄦ帰鏌ュ櫒妫€娴嬮〉闈㈣剼鏈嚱鏁版晥鐜囩瓑锛屾垜浠皢鍦ㄦ湰绡囨枃绔犱腑璁茶В銆傚皬寮熸嫏绗紝姝ゅ浠呬负鎶涚爾銆?
娴忚鍣ㄦā寮?/span>
搴斾簡銆婃棤闂撮亾銆嬬殑閭e彞璇濃€斺€斺€滃嚭鏉ユ贩锛岃繜鏃╂槸瑕佽繕鐨勶紒鈥濄€侷E6绉嶄笅鐨勮嫤鏋滐紝鐜板湪鏋滅劧鍒颁簡瑕佸捊涓嬬殑鏃跺€欎簡銆傚綋IE8鍙戝竷鐨勬椂鍊欙紝浠栦笉寰椾笉闈㈠鐫€涓栫晫涓婃垚鍗冧笂涓団€滃彧鏈夊湪IE6涓墠鑳芥甯告樉绀衡€濈殑椤甸潰銆備笉鍙戝竷IE8浜嗗惂锛孎ireFox鍜孋hrome鍙堣窡鐫€鍚庨潰鎶㈣泲绯曪紱涓嶇閭d簺鈥淚E6 only鈥濈殑椤甸潰鍚э紝閭f祻瑙堝櫒鍑烘潵杩樹笉琚汉楠傛锛涜鎵€鏈夌殑绔欓暱閮芥妸椤甸潰閲嶆瀯鍚э紝鎯虫兂鑷繁閮借绗戙€傚攭锛岃繖鍙拫鏁村憖銆?br>鍞夛紝鏈変簡锛屽挶閲囧彇涓€涓墜娈碉紝璁╃敤鎴疯嚜宸卞幓澶勭悊锛屽鏋滀粬纰板埌浜嗏€淚E6 only鈥濋〉闈紝灏辫浠栬嚜宸辨墜鍔ㄥ鐞嗕竴涓嬶紝璁╂祻瑙堝櫒杩樼敤鑰佺殑娓叉煋妯″紡娓叉煋椤甸潰锛岃繖铏界劧楹荤儲浜嗕竴鐐圭敤鎴凤紝浣嗘槸涔熶笉澶辨槸涓姙娉曘€備簬鏄€滄祻瑙堝櫒妯″紡鈥濆嚭鏉ヤ簡銆傝鐧戒簡锛屽氨鏄鐢ㄦ埛閫夋嫨褰撳墠椤甸潰鐢ㄤ綍绉岻E鐗堟湰鍘绘覆鏌撱€?br>涓句釜渚嬪瓙鍚э紝椤轰究缁冧範涓€涓嬨€?a href="http://www.cnblogs.com/JustinYoung/archive/2009/03/02/ie-jiaojianzhushi.html" target="_blank">IE鐨勬湁鏉′欢娉ㄩ噴璇﹁В銆嬶紝鏍稿績浠g爜濡備笅鈥斺€?br>
<div id="divTest">
<!--[if IE 7]>
娴忚鍣ㄦ槸IE7
<![endif]-->
<!--[if IE 8]>
娴忚鍣ㄦ槸IE8
<![endif]-->
</div>
璁╂垜浠潵璇曡瘯杩欎釜椤甸潰锛屽湪涓嶅悓鐨勬祻瑙堝櫒妯″紡涓嬬殑鏄剧ず鏁堟灉鍚р€斺€?br>
瀵逛簬鏅€氱敤鎴凤紝寰蒋瀹樻柟鎺ㄨ崘鐨勬槸杩欎釜鐜╂剰鈥斺€斿吋瀹规€ц鍥炬寜閽€?br>
褰撶劧锛屽鍓嶇寮€鍙戜汉鍛樻潵璇达紝杩欎釜宸ュ叿涓昏鐢ㄦ潵娴嬭瘯椤甸潰澶氭祻瑙堝櫒鍏煎鎬ц€屽凡銆備絾鏄潪甯搁仐鎲剧殑鏄細娌℃湁IE6妯″紡銆傛病鏈塈E6鐨勪笘鐣岋紝铏界劧鏄竴涓編濂界殑鎰挎湜锛屼絾鏄彲鎯滅殑鏄細鎴戜滑鐢熸椿鍦ㄧ幇瀹炰箣涓紝鎴栬璇寸敓娲诲湪鍦扮嫳涓洿纭垏銆傛墍浠ワ紝鎴戣繕鏄笉寰椾笉鎻愪笅闈㈢殑涓や釜宸ュ叿鈥斺€?br>
IE澶氱増鏈叡瀛樼殑瑙e喅鏂规鈥斺€擨ETester
寰蒋缃戦〉寮€鍙戣皟璇曞埄鍣⊿uperPreview锛堥檮涓嬭浇锛?/span>
鏂囨湰妯″紡
璇磋捣鈥滄枃鏈ā寮忊€濊繖涓悕璇嶏紝杩欏張瑕佸洖鍒版覆鏌撻〉闈㈢殑3绉嶆ā寮忎簡锛氳寮傛ā寮忥紙Quirks mode锛屼篃鏈夌炕璇戜负鍏煎妯″紡銆佹€紓妯″紡鐨勶級锛屾爣鍑嗘ā寮忥紙Standards mode锛夛紝鍜屽嚑涔庢爣鍑嗘ā寮忥紙Almost standards mode锛夈€傝繖鏄竴涓潪甯搁噸瑕併€佷絾鏄緢澶氫汉鍗存瘮杈冩ā绯婄殑姒傚康銆備竴涓ゅ彞璇濅笉澶兘璇存竻妤氾紝杩欐牱璇村惂鈥斺€斺€滈〉闈㈢殑涓嶅悓娓叉煋妯″紡锛屽皢鐩存帴褰卞搷椤甸潰鐨勬渶缁堝憟鐜版晥鏋?鈥濓紝涔熷氨鏄锛屼竴涓〉闈㈠鏋滃湪杩欑妯″紡涓嬫樉绀哄畬缇庯紝浣嗘槸鍦ㄥ彟澶栦竴绉嶆ā寮忎笅鍙兘灏辨樉绀虹殑涓€濉岀硦娑傘€傝€屽喅瀹氶〉闈㈡ā寮忕殑鏄〉闈㈢殑!DOCTYPE灞炴€с€?br>涔栦箹锛岃繖鐜╂剰澶粫浜轰簡锛岃繕鏄洿鎺ヤ笂渚嬪瓙鍚с€傛渶缁忓吀鐨勫氨鏄鐩掕妯″瀷鐨勮В閲婂樊寮備簡銆備笅闈袱涓浘锛屾槸鐩稿悓椤甸潰锛岄噰鐢ㄤ笉鍚岄〉闈㈡覆鏌撴ā寮忕殑鏈€缁堟樉绀烘晥鏋溿€?br>椤甸潰寰堢畝鍗曪紝鍙涓€涓猟iv鍏冪礌锛岀劧鍚庨殢渚胯缃竴鐐归珮搴︺€佸搴︺€乸adding銆乵argin灏卞彲浠ヤ簡銆傛牳蹇冧唬鐮佸涓嬧€斺€?br>
<style type="text/css">
#divTest{
聽 聽 background-color:red;
聽 聽 padding:10px;
聽 聽 margin:10px;
聽 聽 width:100px;
聽 聽 height:100px;
}
</style>
<div id="divTest">
<!--[if IE 7]>
娴忚鍣ㄦ槸IE7
<![endif]-->
<!--[if IE 8]>
娴忚鍣ㄦ槸IE8
<![endif]-->
</div>
浠庡
娴忚鍣ㄦā寮?/span>
搴斾簡銆婃棤闂撮亾銆嬬殑閭e彞璇濃€斺€斺€滃嚭鏉ユ贩锛岃繜鏃╂槸瑕佽繕鐨勶紒鈥濄€侷E6绉嶄笅鐨勮嫤鏋滐紝鐜板湪鏋滅劧鍒颁簡瑕佸捊涓嬬殑鏃跺€欎簡銆傚綋IE8鍙戝竷鐨勬椂鍊欙紝浠栦笉寰椾笉闈㈠鐫€涓栫晫涓婃垚鍗冧笂涓団€滃彧鏈夊湪IE6涓墠鑳芥甯告樉绀衡€濈殑椤甸潰銆備笉鍙戝竷IE8浜嗗惂锛孎ireFox鍜孋hrome鍙堣窡鐫€鍚庨潰鎶㈣泲绯曪紱涓嶇閭d簺鈥淚E6 only鈥濈殑椤甸潰鍚э紝閭f祻瑙堝櫒鍑烘潵杩樹笉琚汉楠傛锛涜鎵€鏈夌殑绔欓暱閮芥妸椤甸潰閲嶆瀯鍚э紝鎯虫兂鑷繁閮借绗戙€傚攭锛岃繖鍙拫鏁村憖銆?br>鍞夛紝鏈変簡锛屽挶閲囧彇涓€涓墜娈碉紝璁╃敤鎴疯嚜宸卞幓澶勭悊锛屽鏋滀粬纰板埌浜嗏€淚E6 only鈥濋〉闈紝灏辫浠栬嚜宸辨墜鍔ㄥ鐞嗕竴涓嬶紝璁╂祻瑙堝櫒杩樼敤鑰佺殑娓叉煋妯″紡娓叉煋椤甸潰锛岃繖铏界劧楹荤儲浜嗕竴鐐圭敤鎴凤紝浣嗘槸涔熶笉澶辨槸涓姙娉曘€備簬鏄€滄祻瑙堝櫒妯″紡鈥濆嚭鏉ヤ簡銆傝鐧戒簡锛屽氨鏄鐢ㄦ埛閫夋嫨褰撳墠椤甸潰鐢ㄤ綍绉岻E鐗堟湰鍘绘覆鏌撱€?br>涓句釜渚嬪瓙鍚э紝椤轰究缁冧範涓€涓嬨€?a href="http://www.cnblogs.com/JustinYoung/archive/2009/03/02/ie-jiaojianzhushi.html" target="_blank">IE鐨勬湁鏉′欢娉ㄩ噴璇﹁В銆嬶紝鏍稿績浠g爜濡備笅鈥斺€?br>
<div id="divTest">
<!--[if IE 7]>
娴忚鍣ㄦ槸IE7
<![endif]-->
<!--[if IE 8]>
娴忚鍣ㄦ槸IE8
<![endif]-->
</div>
璁╂垜浠潵璇曡瘯杩欎釜椤甸潰锛屽湪涓嶅悓鐨勬祻瑙堝櫒妯″紡涓嬬殑鏄剧ず鏁堟灉鍚р€斺€?br>
IE8寮€鍙戜汉鍛樺伐鍏蜂箣娴忚鍣ㄦā寮?/span>
瀵逛簬鏅€氱敤鎴凤紝寰蒋瀹樻柟鎺ㄨ崘鐨勬槸杩欎釜鐜╂剰鈥斺€斿吋瀹规€ц鍥炬寜閽€?br>
褰撶劧锛屽鍓嶇寮€鍙戜汉鍛樻潵璇达紝杩欎釜宸ュ叿涓昏鐢ㄦ潵娴嬭瘯椤甸潰澶氭祻瑙堝櫒鍏煎鎬ц€屽凡銆備絾鏄潪甯搁仐鎲剧殑鏄細娌℃湁IE6妯″紡銆傛病鏈塈E6鐨勪笘鐣岋紝铏界劧鏄竴涓編濂界殑鎰挎湜锛屼絾鏄彲鎯滅殑鏄細鎴戜滑鐢熸椿鍦ㄧ幇瀹炰箣涓紝鎴栬璇寸敓娲诲湪鍦扮嫳涓洿纭垏銆傛墍浠ワ紝鎴戣繕鏄笉寰椾笉鎻愪笅闈㈢殑涓や釜宸ュ叿鈥斺€?br>
IE澶氱増鏈叡瀛樼殑瑙e喅鏂规鈥斺€擨ETester
寰蒋缃戦〉寮€鍙戣皟璇曞埄鍣⊿uperPreview锛堥檮涓嬭浇锛?/span>
鏂囨湰妯″紡
璇磋捣鈥滄枃鏈ā寮忊€濊繖涓悕璇嶏紝杩欏張瑕佸洖鍒版覆鏌撻〉闈㈢殑3绉嶆ā寮忎簡锛氳寮傛ā寮忥紙Quirks mode锛屼篃鏈夌炕璇戜负鍏煎妯″紡銆佹€紓妯″紡鐨勶級锛屾爣鍑嗘ā寮忥紙Standards mode锛夛紝鍜屽嚑涔庢爣鍑嗘ā寮忥紙Almost standards mode锛夈€傝繖鏄竴涓潪甯搁噸瑕併€佷絾鏄緢澶氫汉鍗存瘮杈冩ā绯婄殑姒傚康銆備竴涓ゅ彞璇濅笉澶兘璇存竻妤氾紝杩欐牱璇村惂鈥斺€斺€滈〉闈㈢殑涓嶅悓娓叉煋妯″紡锛屽皢鐩存帴褰卞搷椤甸潰鐨勬渶缁堝憟鐜版晥鏋?鈥濓紝涔熷氨鏄锛屼竴涓〉闈㈠鏋滃湪杩欑妯″紡涓嬫樉绀哄畬缇庯紝浣嗘槸鍦ㄥ彟澶栦竴绉嶆ā寮忎笅鍙兘灏辨樉绀虹殑涓€濉岀硦娑傘€傝€屽喅瀹氶〉闈㈡ā寮忕殑鏄〉闈㈢殑!DOCTYPE灞炴€с€?br>涔栦箹锛岃繖鐜╂剰澶粫浜轰簡锛岃繕鏄洿鎺ヤ笂渚嬪瓙鍚с€傛渶缁忓吀鐨勫氨鏄鐩掕妯″瀷鐨勮В閲婂樊寮備簡銆備笅闈袱涓浘锛屾槸鐩稿悓椤甸潰锛岄噰鐢ㄤ笉鍚岄〉闈㈡覆鏌撴ā寮忕殑鏈€缁堟樉绀烘晥鏋溿€?br>椤甸潰寰堢畝鍗曪紝鍙涓€涓猟iv鍏冪礌锛岀劧鍚庨殢渚胯缃竴鐐归珮搴︺€佸搴︺€乸adding銆乵argin灏卞彲浠ヤ簡銆傛牳蹇冧唬鐮佸涓嬧€斺€?br>
<style type="text/css">
#divTest{
聽 聽 background-color:red;
聽 聽 padding:10px;
聽 聽 margin:10px;
聽 聽 width:100px;
聽 聽 height:100px;
}
</style>
<div id="divTest">
<!--[if IE 7]>
娴忚鍣ㄦ槸IE7
<![endif]-->
<!--[if IE 8]>
娴忚鍣ㄦ槸IE8
<![endif]-->
</div>
IE8寮€鍙戜汉鍛樺伐鍏蜂箣鏂囨湰妯″紡
浠庡