2019-02-27T21:06:20
Take the following HTML snippet:
<ul> <li></li> <li></li> <li></li> <li>Second to Last</li> <li></li> </ul>
We would like to select the second to last list item (<li>
). Here's how we'd go about doing that:
ul li:nth-last-child(2) { color: blue; }
Or, the inverse …