In CSS, can you target an element, then exclude instances of it based on parent wrapper elements higher up the DOM?
For example:
HTML
<div class="wrap">
<ul>
<li>link</li>
<li>link</li>
<li>link</li>
</ul>
</div>
<ul>
<li>link</li>
<li>link</li>
<li>link</li>
</ul>
CSS
li {
color:red;
}
li:not(.wrap li) {
colour:blue;
}
So in this instance, I want to exclude the first series of <li>
tags based on their parent wrapper. Is this achievable with CSS? (and I don't mean just target .wrap li
and apply the desired styles there, as in my case I have to exclude)