Essentially I want all "a" elements to be red, except in situation where they are a descendant child of an element with an attribute property of "data-foo".
This html:
<div data-foo="whatever">
<div>
... more descendants
<a href="#">I should be default color</a>
</div>
</div>
<a href="#">I should be red</a>
With this CSS:
:not([data-foo]) a {
color: red;
}
In this example still selects both "a" elements. I also tried the following:
div:not([data-foo]) a
*:not([data-foo]) a
div:not([data-foo]) a
*:not(div[data-foo]) a
But I'm either getting nothing selected or all selected. Is this a possible selection to make?