Html5已經(jīng)風(fēng)靡很久了,不研究html5+css3實(shí)在有些過(guò)不去,今天先從最基本的開(kāi)始介紹吧,讓ie家族老前輩能夠認(rèn)識(shí)html5的新標(biāo)簽。
1.頁(yè)面中加入代碼
-
<!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->
2.定義一下CSS代碼(Important)
.代碼
-
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {display:block;}
這個(gè)js文件原來(lái)的內(nèi)容很少,現(xiàn)在可能更新了版本代碼量加大了。具體差異在哪里我沒(méi)有細(xì)究,貼出原來(lái)的代碼。應(yīng)該還是可以使用的。
.代碼
-
(function(){if(!/*@cc_on!@*/ 0 )return;var e = "abbr,article,aside,audio,canvas,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video" .split( ',' ),i=e.length;while(i--){document.createElement(e[i])}})()
要的朋友拿去吧??梢灾苯臃诺巾?yè)面中。不過(guò)注意第二步,給html5標(biāo)簽定義上display:block屬性。