:nth-child() of <selector>Baseline · Widely available
The of syntax for the :nth-child() and :nth-last-child() CSS functional pseudo-classes match elements by the relative position of elements, counted from the first or last sibling matching a selector list.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since May 9, 2023. Widely available since Nov 9, 2025.
Browser support
DesktopChrome
1–110Not supported
111+Supportedsince Mar 7, 2023
Current: 155Edge
12–110Not supported
111+Supportedsince Mar 13, 2023
Current: 154Firefox
1–112Not supported
113+Supportedsince May 9, 2023
Current: 157Safari
1–8Not supported
9+Supportedsince Sep 30, 2015
Current: 27MobileChrome Android
18–110Not supported
111+Supportedsince Mar 7, 2023
Current: 155Firefox Android
4–112Not supported
113+Supportedsince May 9, 2023
Current: 157Safari iOS
1–8Not supported
9+Supportedsince Sep 16, 2015
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN — see the links below.
Feature detection
CSS · check before using
@supports selector(:nth-child(*)) {
/* styles that use :nth-child(*) */
}
/* or in JavaScript */
if (CSS.supports("selector(:nth-child(*))")) {
// use it
}Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| nth-child.of_syntax | 111 | 111 | 113 | 9 | 111 | 113 | 9 |
| nth-last-child.of_syntax | 111 | 111 | 113 | 9 | 111 | 113 | 9 |