【问题标题】:CSS declaration overrideCSS 声明覆盖
【发布时间】:2013-08-12 05:51:33
【问题描述】:
#header {
   width:100%;
   height:200px;
}

#theme.theme1 .handle {
   background:blue; 
} 

#header.noback { 
   background:none;   
}

为什么最后一个声明没有覆盖这里?

http://jsfiddle.net/5VnAs

【问题讨论】:

标签: css


【解决方案1】:

这是由于 CSS specificity 造成的。如果将最后一条规则更改为

#header.noback.handle{ 
   background:none;   
}

jsFiddle example

有效

【讨论】:

    猜你喜欢
    • 2016-08-27
    • 2013-06-03
    • 2019-04-02
    • 2021-05-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多