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
source
share