is there a possibility to select just a single last <li> in each multi-level list?
<ul class="root">
<li>no</li>
<li>no</li>
<li>yes</li>
</ul>
<ul class="root">
<li>no</li>
<li>no</li>
<li>
<ul>
<li>no</li>
<li>yes</li>
</ul>
</li>
</ul>
Free playground on jsfiddle:
http://jsfiddle.net/dizzyn/KMY3U/
Yes you can, use
:last-childCSS selector..My fiddle
CSS
You can also use this :
CSS
:last-childselector selects every element that is the last child of its parent.Note : This was a CSS3 implementation, so some browser’s will ignore this but wont spoil anything cuz you are just changing the color..