How to target the last 3 lists together? I have tried using child selectors, but it allows us to target only one element simultaneously.
CodePudding user response:
div > li:nth-last-child(-n 3) {
background-color: aqua;
}
<div>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</div>