`
agevs
  • 浏览: 67802 次
  • 来自: 北京
博客专栏
924aba1e-229a-352e-b6d4-f15f3159a438
各种Web前端技巧经验分享...
浏览量:0
文章分类
社区版块
存档分类
最新评论

让ie浏览器支持html5标签的实现方法

阅读更多

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属性。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics