• ie浏览器兼容性快速处理小招


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <style type="text/css">
        html{font-weight:bold}/*all*/
        *html{text-decoration:underline}/*for IE6*/
        *+html{font-style:italic}/*for IE7*/
        .tt
        {
            color:Red; /*all*/
            #color:Green; /* for IE*/
            *color:Blue; /* for IE7*/
            _color:Gray; /* for IE6*/
        }
        </style>
    </head>
    <body>
        <div class="tt">
        ie6下你看见的是:加粗下划线灰色字体<br/>
        ie7下你看见的是:加粗倾斜蓝色字体<br/>
        其他浏览器你看见的是:加粗红色字体
        </div>
    </body>
    </html>

    以上是快速处理方法,当然,我们通常会这样写来区分浏览器:

    <!--[if lt ie 9]>
        ......
    <![endif]-->

    这里要做一个特别的说明:就是IE特有的注释判断:

    lte:就是Less than or equal to的简写,也就是小于或等于的意思。

    lt :就是Less than的简写,也就是小于的意思。

    gte:就是Greater than or equal to的简写,也就是大于或等于的意思。

    gt :就是Greater than的简写,也就是大于的意思。

    ! : 就是不等于的意思,跟javascript里的不等于判断符相同,如<!--[if !ie]>,表示非IE浏览器下的设置

    因为IE9虽然支持html5标签,但支持的不是很完整,所以,也可以写"lte",这取决于你的选择!

  • 相关阅读:
    闭包
    函数的嵌套和作用域链
    函数命名空间
    初识函数
    快捷键
    centos7 配置远程ssl证书访问docker
    centos 7 修改主机名称hostname
    centos7 在docker中安装gocron
    centos7 在docker中安装mongodb
    centos7 在docker中安装redis
  • 原文地址:https://www.cnblogs.com/kandyvip/p/3456999.html
Copyright © 2020-2023  润新知