`

H5 IE9及以下版本兼容h5新标签

阅读更多

使用他们能让代码语义化更直观,而且更方便SEO优化。但是此HTML5新标签在IE6/IE7/IE8上并不能识别,需要进行JavaScript处理。
如果是IE9及以下的IE浏览器将创建HTML5标签。

<!--[if lt IE9]> 
<script type="text/javascript">
(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])}})();
</script>
<![endif]-->

 

添加 CSS 样式

article,aside,dialog,footer,header,section,footer,nav,figure,menu{display:block}

 

这样,IE9及以下版本就可以使用h5标签了。

 

 

 

 

 

1
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics