I have a quite interesting problem here.
I want to target elements that match two conditions at the same time, but I can not find the way
<div class='redLink'>
<!-- ... ... ... -->
<a href='#'>Link</a>
<!-- ... ... ... -->
</div>
<div>
<!-- ... ... ... -->
<a href='#' class='redLink'>Link</a>
<!-- ... ... ... -->
</div>
My ideal CSS would be
[*:not(.redLink) a] AND [* a:not(.redLink)] {
color:green;
/* i.e., color NOT red */
}
However, the operand ,
is just an OR
(and, when it doesn't match one condition, it matches the other...!).
And the only AND
I can find is the logical concatenation div#myDivId.someClass
, though what I would like is something like [div#myDiv a].[div.someClass a]
My goal is to target ONLY those anchors <a/>
that don't have the class .redLink
and have no parents with the .redLink
class eiher.
And, very important, the only thing I want to target is the final anchor, not the whole div or the whole element.redLink
...
Thank you!