zoukankan      html  css  js  c++  java
  • IE6,7,8,9还有火狐浏览器的兼容

    /*FF、Opear等支持Web标准的浏览器*/
    #header {
            margin-top: 23px;
            margin-bottom: 23px;
    }
    /*IE6浏览器*/
    *html #header { 
            margin-top: 13px;
            margin-bottom: 13px; 

    /*IE7浏览器*/
    *+html #header { 
            margin-top: 18px;
            margin-bottom: 18px; 
    }

    因此,当你在遇到这种情况的时候可以用
    * html   来定义IE6
    *+html   来定义IE7

    更新:
    还有一种css hack直接与其他浏览器一起写在一条css表达式中


    #header{
    margin-top: 13px;     /* 所有浏览器都支持 */
    margin-top: 13px !important;     /* Firefox、IE7支持 */
    _margin-top: 13px;     /* IE6支持 */
    *margin-top: 13px;     /* IE6、IE7支持 */
    +margin-top: 13px;     /* IE7支持 */
    margin-top: 13px9;     /* IE6、IE7、IE8、IE9支持 */
    margin-top: 13px;     /* IE8、IE9支持 */
    }


    需要注意书写顺序:所有浏览器、Firefox、IE8、IE7、IE6依次排列。

  • 相关阅读:
    day 22 反射,双下方法
    day 21 封装,多态,类的其他属性
    day 20 类与类之间的关系,继承2
    day 19 类的名称空间,组合,派生
    day 18 类,对象
    day 17 re模块
    注意NULL
    SQL_DISTINCT
    重载赋值运算符
    随机序列问题
  • 原文地址:https://www.cnblogs.com/yuxingyoucan/p/5897437.html
Copyright © 2011-2022 走看看