码迷,mamicode.com
首页 > Web开发 > 详细

ie6,7,8支持html5的方法

时间:2014-12-31 17:53:52      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

ie9以上的都html5标签,ie9以下的不支持。为了让ie9以下的浏览器支持html5标签。有如下两种方法

当然,这样做的前提是设置这些html5标签都为block,ection,header,article,time,nav,footer,figure,figcaption{display:block;}

然后,方法如下:

1.

<!--[if IE]>
<script>
(function(){if(!/*@cc_on!@*/0){alert("ie10");}var e = "header,footer,nav,article,section".split(‘,‘),i=e.length;while(i--){document.createElement(e[i])}})()
</script>
<![endif]-->

 

2.直接饮用google的

 

<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]--> 

 

ie6,7,8支持html5的方法

标签:

原文地址:http://www.cnblogs.com/jiaojiaome/p/4196106.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!