How have can I set styles for the last list element of the nested list. I want these styles to be applied only to elements with the class "match".
Here is the code example:
HTML:
<ul>
<li>
<ul>
<li class="match">x1 match</li>
<li class="match">y1 match</li>
<li>z1</li>
</ul>
</li>
<li>
<ul>
<li>x2 match</li>
<li class="match">y2 match</li>
<li>z2</li>
</ul>
</li>
<li>
<ul>
<li class="match">x3 match</li>
<li class="match">y3 match</li>
<li class="match">y3 match</li>
</ul>
</li>
</ul>
CSS:
ul li ul li:last-of-type {
color: red;
}
To be specific in this example I want next items to be selected:
- y1 match
- y2 match
- y3 match
Thank you