您的位置:首页 > 其它

<!--[if IE 6]><![endif]-->等语句含义

2017-04-17 09:53 337 查看
经常会看到某些网站的框架中会用到
<!--[if IE7]><![endif]-->
等语句,今天特意查阅了下它们的区别:

<!--[if IE]>所有的IE可识别<![end if]-->
<!--[if !IE]>除IE外都能识别<![end if]-->
<!--[if lt IE6]>IE6以下版本可识别<![endif]-->
<!--[if lte IE6]>IE6以及IE6以下版本可识别<![endif]-->
<!--[if gt IE6]>IE6以上版本可识别<![endif]-->
<!--[if gte IE6]IE6以及IE6以上版本可识别<![endif]-->


!: 代表不等于;

lt: less than,小于;

lte: less than or equal to,小于或等于;

gt: greater than,大于

gte: greater than or equal to,大于或等于

相关参考资料:

https://css-tricks.com/how-to-create-an-ie-only-stylesheet/



IE6以及IE6以下版本的两种写法:



另一例子(来源:https://www.quirksmode.org/css/condcom.html):



更多参考资料看查看:

https://www.sitepoint.com/web-foundations/internet-explorer-conditional-comments/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: