I have the following css which needs to alter the last-child which does not have the class “myClass” but I can’t seem to get it to work.
Any ideas where I’m going wrong?
ul li:not(.myClass):last-child a {
font-style:italic;
}
Example html as requested:
<ul>
<li><a href="#">one</a></li>
<li><a href="#">two</a></li>
<li><a href="#">three</a></li>
<li class="myClass"><a href="#">Extra</a></li>
</ul>
I want to apply the css to li three…
this can’t be done with css only if you are capable to use jQuery you might find this solution helpful.
http://jsfiddle.net/6ku3Y/