zoukankan      html  css  js  c++  java
  • IE6/IE7/IE8/Firefox/Chrome/Safari的CSS hack兼容一览表

    不同的浏览器对CSS的解释都有一点出入,特别是padding, line-height这些要细微控制的地方,下面的hack基本可以解决这个问题: 

    • 在属性前加下划线(_),那么此属性只会被IE6解释 
    • 在属性前加星号(*),此属性只会被IE7解释 
    • 在属性值后面加"\9",表示此属性只会被IE8解释 

    各浏览器CSS hack兼容表:

      IE6 IE7 IE8 Firefox Chrome Safari
    !important   Y   Y    
    _ Y          
    * Y Y        
    *+   Y        
    \9 Y Y Y      
    \0     Y      
    nth-of-type(1)         Y Y

    #test{ 
    color:red; /* 所有浏览器都支持 */ 
    color:red !important;/* Firefox、IE7支持 */ 
    _color:red; /* IE6支持 */ 
    *color:red; /* IE6、IE7支持 */ 
    *+color:red; /* IE7支持 */ 
    color:red\9; /* IE6、IE7、IE8支持 */ 
    color:red\0; /* IE8支持 */ 

    body:nth-of-type(1) p{color:red;} /* Chrome、Safari支持 */

  • 相关阅读:
    [luogu]P1852跳跳棋
    StdDraw绘图
    Java-Timer-Stop
    人之初
    单例模式--延时初始化
    ubuntu忘记密码
    QT5 TK1 串口通信
    金秋十月
    级联分类器训练-----OpenCV
    Hu矩SVM训练及检测-----OpenCV
  • 原文地址:https://www.cnblogs.com/jeffrey77/p/2936589.html
Copyright © 2011-2022 走看看