最新ie6/ie7/ie8/ie9版本的Css if hack条件语法操作说明
2011-05-16 17:24
232 查看
1、Css if hack条件语法
< !--[if IE]> Only IE <![endif]-->
仅所有的WIN系统自带IE可识别
< !--[if IE 5.0]> Only IE 5.0 <![endif]-->
只有IE5.0可以识别
< !--[if gt IE 5.0]> Only IE 5.0+ <![endif]-->
IE5.0包换IE5.5都可以识别
< !--[if lt IE 6]> Only IE 6- <![endif]-->
仅IE6可识别
< !--[if gte IE 6]> Only IE 6/+ <![endif]-->
IE6以及IE6以下的IE5.x都可识别
<!--[if lte IE 7]> Only IE 7/- <![endif]-->
仅IE7可识别
< !--[if gte IE 7]> Only IE 7/+ <![endif]-->
IE7以及IE7以下的IE6、IE5.x都可识别
<!--[if IE 8]> Only IE 8/- <![endif]-->
仅IE8可识别
<!--[if IE 9]> Only IE 9/- <![endif]-->
仅IE9可识别
注:在 if 后加 lt gte有不同效果 (参加其它参数同理)
<!–[if IE 8]> = IE8 仅IE8可识别
<!–[if lt IE 8]> = IE7或更低版本
<!–[if gte IE 8]> = 高于或者等于IE8版本
2、DIV+CSS实例
CSS实例一:
让IE6-IE8显示不同的内容,DIV CSS代码如下:
说明:以上针对不同IE显示不同网页内容DIV+CSS实例实验。
DIV+CSS实例二:
让IE6-IE8显示不同CSS样式效果,DIV CSS代码如下:
说明:以上实验仅实验IE6-IE9下if HACK。
< !--[if IE]> Only IE <![endif]-->
仅所有的WIN系统自带IE可识别
< !--[if IE 5.0]> Only IE 5.0 <![endif]-->
只有IE5.0可以识别
< !--[if gt IE 5.0]> Only IE 5.0+ <![endif]-->
IE5.0包换IE5.5都可以识别
< !--[if lt IE 6]> Only IE 6- <![endif]-->
仅IE6可识别
< !--[if gte IE 6]> Only IE 6/+ <![endif]-->
IE6以及IE6以下的IE5.x都可识别
<!--[if lte IE 7]> Only IE 7/- <![endif]-->
仅IE7可识别
< !--[if gte IE 7]> Only IE 7/+ <![endif]-->
IE7以及IE7以下的IE6、IE5.x都可识别
<!--[if IE 8]> Only IE 8/- <![endif]-->
仅IE8可识别
<!--[if IE 9]> Only IE 9/- <![endif]-->
仅IE9可识别
注:在 if 后加 lt gte有不同效果 (参加其它参数同理)
<!–[if IE 8]> = IE8 仅IE8可识别
<!–[if lt IE 8]> = IE7或更低版本
<!–[if gte IE 8]> = 高于或者等于IE8版本
2、DIV+CSS实例
CSS实例一:
让IE6-IE8显示不同的内容,DIV CSS代码如下:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>DIV IF条件实例</title> </head> <body> 你正在使用: <!--[if IE 7]> <h2>IE7</h2> <![endif]--> <!--[if IE 6]> <h2>IE6</h2> <![endif]--> <!--[if IE 8]> <h2>IE8</h2> <![endif]--> <!--[if IE 9]> <h2>IE9</h2> <![endif]--> <br><br> <strong>说明</strong>:如果你的浏览器版本为多少即会显示IE多少,针对IE6-IE9实验</body> </html> |
DIV+CSS实例二:
让IE6-IE8显示不同CSS样式效果,DIV CSS代码如下:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>CSS IF条件hack实例</title> <!--[if IE 6]> <style type="text/css"> .divcss{ color:#F00;} </style> <![endif]--> <!--[if IE 7]> <style type="text/css"> .divcss{ color:#FF0;} </style> <![endif]--> <!--[if IE 8]> <style type="text/css"> .divcss{ color:#00F;} </style> <![endif]--> <!--[if IE 9]> <style type="text/css"> .divcss{ color:#000;} </style> <![endif]--> </head> <body> <div class="divcss"> DIV CSS实验提示:<br> 我在IE6下是红颜色,在IE7下是黄颜色,在IE8下是蓝颜色,在IE9下是黑色 </div> </body> </html> |
相关文章推荐
- IE系列的Css if hack条件语法
- Css if hack条件语法
- 最新区分兼容IE6/IE7/IE8/IE9/FF的CSS HACK写法和Css if hack条件语
- 条件注释判断兼容浏览器版本CSS HACK <!--[if !IE]><!--[if IE]><!--[if lt IE 6]><!--[if gte IE 6]>
- CSS if条件hack
- css中使用if条件在各大浏览器(IE6\IE7\IE8)中hack方法解决教程
- 创建IE各版本专属CSS IE中的if语句
- jQuery 中关于CSS操作部分使用说明
- redis3.2 最新版本启动配置文件redis.conf详细说明
- (转)CSS布局参考 IE的If条件注释使用备忘
- 安全化mysql的where条件输入拼接面板:用于给不会mysql语法的操作人使用
- hive中使用case、if:一个region统计业务(hive条件函数case、if、COALESCE语法介绍:CONDITIONAL FUNCTIONS IN HIVE)
- shell if条件中判断文件或字符操作
- 针对主流浏览器的CSS-HACK写法及IE常用条件注释
- php常见语法错误 if()条件
- shell中if条件的二元操作比较符
- if条件和for循环语句、while、do..while、switch语法
- Flex swf 升级后,客户端不需要清空缓存即可查看最新版本的使用说明
- 转:已知2个整形数据a,b.不使用if,?:以及其他任何条件判断的语法,找出a跟b中数据的大者。
- 针对主流浏览器的CSS-HACK写法及IE常用条件注释