关于ie中的hack以及条件注释方法
2016-10-12 14:25
381 查看
由于现在一般都最低要求只支持到ie8浏览器以上,所以不再管ie6 7
1:条件注释
ie中条件注释使用方法
gt : greater than,选择条件版本以上版本,不包含条件版本
lt : less than,选择条件版本以下版本,不包含条件版本
gte : greater than or equal,选择条件版本以上版本,包含条件版本
lte : less than or equal,选择条件版本以下版本,包含条件版本
! : 选择条件版本以外所有版本,无论高低
2:hack
\9
例子:
1:条件注释
ie中条件注释使用方法
<!--[if IE 5]>仅IE5.5可见<![endif]--> <!--[if gt IE 5.5]>仅IE 5.5以上可见<![endif]--> <!--[if lt IE 5.5]>仅IE 5.5以下可见<![endif]--> <!--[if gte IE 5.5]>IE 5.5及以上可见<![endif]--> <!--[if lte IE 5.5]>IE 5.5及以下可见<![endif]--> <!--[if !IE 5.5]>非IE 5.5的IE可见<![endif]-->
gt : greater than,选择条件版本以上版本,不包含条件版本
lt : less than,选择条件版本以下版本,不包含条件版本
gte : greater than or equal,选择条件版本以上版本,包含条件版本
lte : less than or equal,选择条件版本以下版本,包含条件版本
! : 选择条件版本以外所有版本,无论高低
2:hack
\9
例子:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .tet{ width: 100px; height: 100px; background: #000; background: red\9; } </style> <!--[if gte IE 8.0]> <style> .tet{ background: red; } </style> <![endif]--> </head> <body> <div class="tet"></div> </body> </html>
相关文章推荐
- 针对主流浏览器的CSS-HACK写法及IE常用条件注释
- 关于IE条件注释(译)
- 针对主流浏览器的CSS-HACK写法及IE常用条件注释
- 关于opacity透明度子元素继承现象的若干研究以及hack方法
- 通过条件注释hack创建只对IE生效的样式<!--[if IE]>
- 针对主流浏览器的CSS-HACK写法及IE常用条件注释
- IE10/11不支持条件性注释后的替代方法
- ie的兼容方法,条件注释的方法
- 学习笔记:IE Hack 条件注释
- 针对主流浏览器的CSS-HACK写法及IE常用条件注释
- 针对主流浏览器的CSS-HACK写法及IE常用条件注释
- 关于IE和非IE浏览器的条件注释
- 关于封QQ,和MSN,以及MSN文件传输的方法一例!!
- 实习结束了,临走还捞了一票...和Jason聊了许多关于以后在校园技术实践以及学习的方法,宝贵经验,记录下来。
- 关于java中main()方法以及命令行参数的若干注意
- 关于在断点处设置条件的方法
- 关于在DataTable中执行DataTable.Select("条件")返回DataTable的解决方法
- 关于hibernate和jsp,以及中文编码问题的传统解决方法