Html5已經(jīng)風(fēng)靡很久了,不研究html5+css3實在有些過不去,今天先從最基本的開始介紹吧,讓ie家族老前輩能夠認(rèn)識html5的新標(biāo)簽。
1.頁面中加入代碼
-
<!--[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;}
這個js文件原來的內(nèi)容很少,現(xiàn)在可能更新了版本代碼量加大了。具體差異在哪里我沒有細(xì)究,貼出原來的代碼。應(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])}})()
要的朋友拿去吧??梢灾苯臃诺巾撁嬷小2贿^注意第二步,給html5標(biāo)簽定義上display:block屬性。