zoukankan      html  css  js  c++  java
  • IE条件注释判断

    相信大家都知道IE有专门的注释条件判断来引入一些css、js、html代码,但是语法有点拗口,记不住,下面我来做一下笔记:

    正常的html注释:
    <!--注释注释注释注释...-->
    
    注释条件判断
    IE7:
    <!--[if IE 7]>
    引入的任何css、js、html
    <![endif]-->
    
    IE7及以上:
    <!--[if gte IE 7]>
    引入的任何css、js、html
    <![endif]-->
    
    IE7及以下:
    <!--[if lte IE 7]>
    引入的任何css、js、html
    <![endif]-->
    
    IE7以上(不含IE7):
    <!--[if gt IE 7]>
    引入的任何css、js、html
    <![endif]-->
    
    IE7以下(不含IE7):
    <!--[if lt IE 7]>
    引入的任何css、js、html
    <![endif]-->
    
    IE7或IE8:
    <!--[if IE 7|IE 8]>
    引入的任何css、js、html
    <![endif]-->
    
    非IE7或IE8:
    <!--[if lt IE 7|gt IE 8]>
    引入的任何css、js、html
    <![endif]-->
    或者
    <!--[if !(IE 7|IE 8)]>
    引入的任何css、js、html
    <![endif]-->

    非IE的写法比较特殊:

    <!--[if !IE]>-->
       任何css、js、html
    <!--<![endif]-->

    IE判断的写法只兼容到IE9,到IE10已经是只显示非IE注释的内容了,所以我们现在习惯叫的IE浏览器其实多是指IE9及以下

  • 相关阅读:
    使用 Sentry集中处理错误
    laravel实现多对多的分析
    windows下phpstorm的快捷键
    npm 升级
    squid----正向代理
    nginx----配置优化
    负载均衡----nginx
    负载均衡----HAproxy
    负载均衡----LVS
    mysql-8.0.12读写分离
  • 原文地址:https://www.cnblogs.com/amiezhang/p/8244019.html
Copyright © 2011-2022 走看看