I have the following HTML structure:
<ol>
<li><a id="a" href="#">Not this</a></li>
<li><a id="b" href="#">Not this</a></li>
<li><a id="c" href="#">This one</a></li>
<li class="active"><span>Not this</span></li>
</ol>
I want to select #c via CSS. I have tried:
ol > li:not(.active):last-child > a {
border: 1px solid green;
}
As I understand it li:not(.active) selects all the li elements but the one with class .active.
On this selection I use :last-child to get the last of these li elements. But this wont work. What's wrong? Is it possible what I'm trying to achieve?
Thank you very much :)
PS: The list length is dynamic and the elements does not have any id that could be used for CSS selection (I just used some in the example to clarify which element I want to select) ;)