Widely Available
Selectors
id: nth-child
:nth-child()
The
:nth-child() and :nth-last-child() CSS functional pseudo-classes match elements based on their index within a list of elements. The :first-child and :last-child pseudo-classes match the first and last element in a list, and the :only-child pseudo-class matches an element with no siblings.
Baseline Status:
Achieved Widely Available on Jan 29, 2018 (Cross-browser Newly Available since Jul 29, 2015).
Desktop Browser Engine Support
Google Chrome
1
Supported
Mozilla Firefox
3.5
Supported
Apple Safari
3.1
Supported
Microsoft Edge
12
Supported
Mobile Browser Engine Support
Chrome Android
18
Firefox Android
4
Safari iOS
2
Specifications and References
MDN Browser Compat Data Keys:
css.selectors.first-child ↗
css.selectors.first-child.no_parent_required ↗
css.selectors.last-child ↗
css.selectors.last-child.no_parent_required ↗
css.selectors.nth-child ↗
css.selectors.nth-child.no_parent_required ↗
css.selectors.nth-last-child ↗
css.selectors.nth-last-child.no_parent_required ↗
css.selectors.only-child ↗
css.selectors.only-child.no_parent_required ↗