I'm sorry the title is not particularly explanatory, what I mean is as follows
What I want to achieve with the second CSS selector is "All class b elements that are descendants of class a elements but not descendants of class c elements". As you can see, the selector I've written actually selects all class b elements, regardless of whether or not they are descendants of class c elements. (I.e. I want the central div to appear blue rather than red). Why is my selector not working?
Consider the code in the following:
div {
background: blue;
border: 1px solid;
margin: 20px;
min-height: 20px;
max-width: 300px;
}
.a :not(.c) .b {
background: red;
}
<div class="a">
<div>
<div class="b">
<div>
<div class="c">
<div>
<div class="b">
</div>
</div>
</div>
</div>
</div>
</div>
</div>