not()表示特定类

时间:2014-03-30 18:10:54

标签: html css

假设有div的风格和更多的课程 -

div, .exceptDiv, .bigDiv {
    /*style...*/
}

(here its jsFiddle),

我希望保存一个从任何风格中保持清晰的课程 - clearDiv

我试过了 -

div:not(".clearDiv"), .exceptDiv, .bigDiv {
    /*style...*/
}

(here its jsFiddle),

但它没有用。

我正在寻找一种尽可能使用not(...)的解决方案。

1 个答案:

答案 0 :(得分:2)

正确使用not()

div:not(".clearDiv")无效,请删除引号:div:not(.clearDiv)

http://jsfiddle.net/v4YDD/4/