The :nth-last-child CSS pseudo-class matches an element that has an+b-1 siblings after it in the document tree, for a given positive or zero value for n, and has a parent element.

:nth-last-child(number) {
    css declarations;
}
p:nth-last-child(2) {
   color: #3366ff;
   background: #ffff99;
}

Click the button below to experiment with this selector.

Give it a Try!

3.5Firefox 9.0Explorer 4.0Chrome 3.2Safari 9,6Opera