Html5已經風靡很久了,不研究html5+css3實在有些過不去,今天先從最基本的開始介紹吧,讓ie家族老前輩能夠認識html5的新標簽。
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文件原來的內容很少,現在可能更新了版本代碼量加大了。具體差異在哪里我沒有細究,貼出原來的代碼。應該還是可以使用的。
.代碼
-
(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])}})()
要的朋友拿去吧??梢灾苯臃诺巾撁嬷?。不過注意第二步,給html5標簽定義上display:block屬性。