HTML5新标签在IE6/IE7/IE8中的几种兼容方式
来源:互联网 发布:想给自己淘宝店铺刷单 编辑:程序博客网 时间:2024/05/17 06:30
Html5新标签元素:
header,footer,artical,section,aside,nav适用它们能让代码语义化更直观,方便SEO。
两种解决方案:
1,通过document.createElement产生新的标签
<!--[if lt IE 9]> <script> (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(', '); var i= e.length; while (i--){ document.createElement(e[i]) } })() </script><![endif]-->
2,通过比较成熟的框架,比如html5shiv
<!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><script src="//cdn.bootcss.com/html5shiv/r29/html5.min.js"></script><![endif]-->
但是不管使用哪种方法,都需要初始化新标签css,因为HTML5默认情况下是内联元素,需要我们手动改为块状元素:
/*html5*/article,aside,dialog,footer,header,section,footer,nav,figure,menu{display:block}
0 0
- HTML5新标签在IE6/IE7/IE8中的几种兼容方式
- HTML5新标签在IE6/IE7/IE8中的几种兼容方式
- 如何解决IE6/IE7/IE8浏览器不兼容HTML5新标签的问题
- 完美解决IE(IE6/IE7/IE8)不兼容HTML5新标签的方法
- 如何解决IE6/IE7/IE8浏览器不兼容HTML5新标签的问题
- IE(IE6/IE7/IE8)不兼容HTML5标签的方法
- 解决IE6、IE7、IE8、Firefox兼容的几种方案
- HTML5 Shiv--解决IE(IE6-IE7-IE8)不兼容HTML5标签的方法
- 兼容IE6 IE7 IE8
- 解决IE(IE6/IE7/IE8)不兼容HTML5标签的问题[转自大神]
- 完美解决IE(IE6/IE7/IE8)不兼容HTML5标签的方法
- 完美解决IE(IE6/IE7/IE8)不兼容HTML5标签的方法
- 完美解决IE(IE6/IE7/IE8)不兼容HTML5标签的方法
- 完美解决IE(IE6/IE7/IE8)不兼容HTML5标签的方法
- 完美解决IE(IE6/IE7/IE8)不兼容HTML5标签的方法
- 完美解决IE(IE6/IE7/IE8)不兼容HTML5标签的方法
- 完美解决IE(IE6/IE7/IE8)不兼容HTML5标签的方法
- 完美解决IE(IE6/IE7/IE8)不兼容HTML5标签的方法
- opengl丢弃缓存数据相关函数
- nginx学习4——nginx的几个配置文件学习nginx.conf、fastcgi.conf
- LeetCode : Perfect Number
- POJ2349 Arctic Network
- GreenDao3.0新特性解析(配置、注解、加密)
- HTML5新标签在IE6/IE7/IE8中的几种兼容方式
- CUDA优化策略之-achieved occupancy
- 线性结构—栈
- 报错javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException
- 设计模式学习笔记——装饰模式
- 汇编语言实验4-利用跳转指令构造循环
- C语言笔记之技巧
- 构建高效可申缩的结果缓存
- 文章标题Linux下进度条的简单实现