zoukankan      html  css  js  c++  java
  • CSS hack

    1.属性级Hack

    _:选择IE6及以下。连接线(中划线)(-)亦可使用,为了避免与某些带中划线的属性混淆,所以使用下划线(_)更为合适。
    *:选择IE7及以下。诸如:(+)与(#)之类的均可使用,不过业界对(*)的认知度更高
    9:选择IE6+
    :选择IE8+和Opera15以下的浏览器

    如想同一段文字在IE6,7,8显示为不同颜色,可这样写:

    .test {
        color: #c30;          /* For latest Firefox, chrome, Safari */
        color: #090;        /* For Opera15- */
        color: #00f9;        /* For IE8+ */
        *color: #f00;         /* For IE7 */
        _color: #ff0;         /* For IE6 */
    }

    * 上述Hack均需运行在标准模式下,若在怪异模式下运行,这些Hack将会被不同版本的IE相互识别,导致失效。

     

    2.选择符级Hack

    * html .test { color: #090; }       /* For IE6 and earlier */
    * + html .test { color: #ff0; }     /* For IE7 */
    .test:lang(zh-cmn-Hans) { color: #f00; }  /* For IE8+ and not IE */
    .test:nth-child(1) { color: #0ff; } /* For IE9+ and not IE */
  • 相关阅读:
    Restful 的概念预览
    Bootstrap中alerts的用法
    Bootstrap HTML编码规范总结
    Bootstrap中img-circle glyphicon及js引入加载更快的存放位置
    PI数据库
    memcached
    Bootstrap中样式Jumbotron,row, table的实例应用
    js事件监听
    jquery显示隐藏操作
    HDU4521+线段树+dp
  • 原文地址:https://www.cnblogs.com/calin/p/4812430.html
Copyright © 2011-2022 走看看