文章主要的内容为常用的浏览器区分方法,包括注释、脚本等方法。
【注释区分IE】
<!--[if IE]> Only IE <![endif]--> 所有的IE可识别 <!--[if IE 5.0]> Only IE 5.0 <![endif]--> 只有IE5.0可以识别 <!--[if gt IE 5.0]> Only IE 5.0+ <![endif]--> 高于IE5.0都可以识别 <!--[if lt IE 6]> Only IE 6- <![endif]--> 低于IE6可识别 <!--[if gte IE 6]> Only IE 6/+ <![endif]--> IE6以及IE6以上都可识别 <!--[if lte IE 7]> Only IE 7/- <![endif]--> IE7及ie7以下版本可识别 <!--[if !IE]><--><![endif]--> 非ie
lte:Less than or equal to,小于或等于
lt :Less than,小于
gte:Greater than or equal to,大于或等于
gt :Greater than,大于
! :不等于
【CSS Hack】
.demo1{ color:black!important;color:red;/*显示为红色*/}
/*重定义*/
.demo2{color:black!important;}
.demo2{color:red;}/*显示为黑色*/
转载请注明转载自:TOPMING,本文链接地址: http://topming.com/distinguish-browser/
订阅本站:http://topming.com/feed/,投稿联系:
不錯.現在我做前段UI都不考慮ie6了…唉
ie10已经不支持了