可以说我有:
Test for :notThis line should be green.
This line should also be green.
This is another line that should be yellow
我想要做的是选择class =“para”的所有元素,但排除那些具有class =“ds”的元素的后代。我有这个CSS:
.ds { color: grey; border-style:solid; border-width:5px;}
.para {color:yellow;}
.para:not(.ds .para) {color:green; border-style:solid; border-width:5px;} //not working所以我假设我只能有简单的选择器作为一部分:不(S),我不能有:不是(X Y)。我使用铬(18.0.1025.162米)和firefox(10)。有任何想法吗?
注意:请不要说查询是更大问题的一部分,我有一些代码(以gwt为单位),它是从dom中选择元素列表(例如class =“para”)。然而,我发现一个错误,需要排除特定元素集的后代元素(例如class =“ds”)。