nth-last-child

The nth-last-child CSS pseudo-class represents elements that are among An+Bth elements from the list composed of their inclusive siblings that match the selector list S, counting backwards from the end.

If S is omitted, it defaults to *|*.

Syntax

selector:nth-last-child(An+B [of S]? )
{
    property: value;
}

Examples

An+B

of S

even

odd

Internal

first-child

first-of-type

last-child

last-of-type

nth-child

nth-last-of-type

nth-of-type

only-child

only-of-type

External

World Wide Web Consortium (W3C)

Home Menu