Does: not () negation accept descendant selectors?

I used the pseudo-class for :not()styles without having to redefine it with a second unnecessary declaration to undo the first, but now I have come across strange behavior when Safari accepts a child selector in :not(), but Chrome does not.

I used something like a:not(.blue a).

I have been looking for answers, but I still do not quite understand the reason.
Is the child selector allowed by the specification?

Here is a demo:

a:not(.blue a) {
  color: red;
}
<div><a>this one should be in red</a></div>
<div class="blue"><a>this one shouldn't</a></div>

http://codepen.io/oscarmarcelo/pen/YqboQJ?editors=1100

+1
source share
1 answer

3 . :not() .

6.6.7. -

, :not(X), ( ) . , .

?

:

, , , , , .

.

, 4, :not() , . - .

+1

Source: https://habr.com/ru/post/1650378/


All Articles