How do I select only children that don't have a parent with a certain class in their parent tree?
This didn't work:
div:not(.dontSelect) .child
div {
background-color: red;
padding: 5px;
}
div:not(.dontSelect) .child {
background-color: green;
padding: 5px;
}
<div>
<div class="child">
Select this
</div>
<div class="dontSelect">
<div>
<div class="child">
Don't select this
</div>
</div>
</div>
</div>