zoukankan      html  css  js  c++  java
  • 兼容低版本 ie 的思路

    兼容处理 ie 低版本,推荐三条路径: 

    一、css hack,适用于代码初建阶段,也就是说在开发功能之前要思考的问题点,这里总结几个常见的:

    1、- 区分 ie6 与 ie7以上 ( -text-indent: 0;  ie6识别)

    2、* 区分标准 ie7 与 ie8以上标准模式 ( *text-indent: 0; ie7识别 )

    3、 区分标准 ie8+ 与 ie其他低版本( text-indent: 0; ie8+识别 )

    4、9 区分 ie9、10 与 ie其他低版本 ( text-indent: 09; ie9、10识别 )

    5、区分 edge 与 ie ( edge支持的 )

    @supports (-ms-accelerator:true) {
    .add {
    left:34px;
    }
    }
    _:-ms-lang(x),
    .add {
    left:34px;

    二、条件注释 

    1、小于等于某个版本

            <!--[if lte IE 7]>
            <link href="../css/a.css" rel="stylesheet">  
            <![endif]-->
    2、等于
            <!--[if  IE 7]>
            <link href="../css/a.css" rel="stylesheet">  
            <![endif]-->
     
    <!--[if IE 7]>

    <style index="index" data-compress="strip">
    #u1 a.mnav,#u1 a.mnav:visited,#u1 a.lb,#u1 a.lb:visited,#u1 a.pf,#u1 a.pf:visited,#u1 a.bri,#u1 a.bri:visited{font-family:simsun;}
    </style>
    <![endif]-->

    3、大于等于
            <!--[if gte IE 7]>
            <link href="../css/a.css" rel="stylesheet">  
            <![endif]--> 
     
    三、能力判断后动态加载资源/添加处理程序
    1.能力判断
    return 'placeholder' in document.createElement('input');
    return navigator.userAgent.indexOf("7.0")>0
    2.动态加载
    $("<link>")
    .attr({
    rel: "stylesheet",
    type: "text/css",
    href: "/css/disabled.css"
    })
    .appendTo("head");
     
    扩展:谷歌   火狐 hack
    谷歌:@media screen and (-webkit-min-device-pixel-ratio:0)
    火狐:@-moz-document url-prefix()  

    @-moz-document url-prefix()    /*Firefox*/

    {

            body

            {

                   

            }

    }

     
     
    Put the favorites in the favorites and empty the favorites.
  • 相关阅读:
    安卓 出现Cannot launch AVD in emulator 错误
    服务器架构中,集群,负载均衡,分布式有什么区别吗
    JavaScript事件
    替换节点内文本的万用函数
    DOM(Document Object Module,文档对象模型)为JavaScript提供完整,全面控制网页结构与内容的对象
    c++和java的区别
    解决Spark集群无法停止
    spark 作业调度
    hadoop,hbase,hive,zookeeper整合可行性分析及版本确定
    hadoop+spark+kudu
  • 原文地址:https://www.cnblogs.com/justSmile2/p/9403340.html
Copyright © 2011-2022 走看看