IE6/IE7/IE8兼容H5标签

可以使用html5shiv(html5shiv主要解决HTML5提出的新元素不被IE6-8识别,这些新元素不能作为父节点包裹子元素,并且不能应用CSS样式)来解决

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

代码说明:在 IE 浏览器的版本小于 IE9 时读取 html5shiv.js 文件并解析

Google 资源库在国内不稳定,国内用户可以使用:

<!--[if lt IE 9]>
  <script src="http://cdn.bootcss.com/html5shiv/r29/html5.min.js"></script>
<![endif]-->

 注:html5shiv.js 引用代码必须放在 <head> 元素中,因为 IE 浏览器在解析 HTML5 新元素时需要先加载该文件

原文地址:https://www.cnblogs.com/cui-ting/p/10842409.html