:nth-last-of-type
:nth-last-of-type is a CSS pseudo-class in the Pseudo-classes category. Selects elements by position from end among same type. The syntax is :nth-last-of-type(<n>). A typical example: p:nth-last-of-type(2) { font-weight: bold; } It is commonly applied to markup such as <div class="demo">Sample</div> Browser support: Chrome 1+, Firefox 1+, Safari 1+, Edge 12+. A close relative is :hover, which applies styles when the user hovers over an element with a pointing device. A close relative is :focus, which applies styles when an element has received focus. A close relative is :active, which applies styles while an element is being activated (clicked). More about this category: CSS pseudo-classes for targeting elements based on state or position. Related Pseudo-classes entries: :hover, :focus, :active, :visited, :link, :focus-within, :focus-visible, :target. This page is part of the free CSS Reference documentation covering 841+ properties, selectors, functions, and at-rules, each with syntax, values, examples, and browser support.