Working Ninja
Get Second to Last Element via CSS

Take the following HTML snippet:

    <li>Second to Last</li>

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 (everything but the second to last element):

ul li:not(:nth-last-child(2)) { color: red; }