:nth-last-child()

The :nth-last-child pseudo-class is used to style elements based on the numbering in the element tree. Unlike the :nth-child pseudo-class, it doesn't count from the first element, but from the last.

Syntax



element:nth-last-child (odd | even | number | expression) {
  property: value;
}