zoukankan      html  css  js  c++  java
  • css hack基本语法

    CSS Hack 分为三类:css类内部hack  、选择器hack  html头部引用hack

    有以下几种写法:

    1

    1ie6  可识别不可识别Important

    2ie7  识别*   识别Important

    3ff   不可识别识别Important

    区分ff   ie7  ie6(按顺序)

    .test{

    background-color:red;

    *background-color:red !important;

    *background-color:red;

    }

    .test{

    background-color:red;

    *background-color:red ;

    _background-color:red;

    }

    2】(class=“test”)

    ie6     *html.test{}    

    ie 7     *+html.test{}

    *+html必须保证HTML顶部有如下声明: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 

    "http://www.w3.org/TR/html4/loose.dtd">  

    3

    ie6 ie7 ie 8    可识别    9  

    ie8 ie9      可识别      

    ie9          可识别   9

     :root #test { background-color:purple9; }  /*仅仅ie9可识别*/

    @media all and (min-0px){ #test {background-color:black;} }  /*opera*/
    @media screen and (-webkit-min-device-pixel-ratio:0){#test {background-color:gray;} }  /*chrome and safari*/

    4

    <!--[if IE 7]> 可以包含style标签,也可以包含普通html代码<![endif]-->

  • 相关阅读:
    Linix的mysql操作
    Linix安装Mongo
    什么是GitHub
    PHP date, strtotime, mktime处理
    正则表达式及使用
    JavaScript的算法和流程控制总结
    JavaScript的DOM编程总结
    Yii中使用的简单方法
    Mongo数据库的导入导出及使用
    linux-0.11内核 任务的堆栈切换
  • 原文地址:https://www.cnblogs.com/xiaonvziyi/p/3191152.html
Copyright © 2011-2022 走看看