← Back to release summary

CSS Selectors 4 Pseudo-Class :nth-child(an + b of S)

Category
CSS
Type
Chromium catches up
Status
Enabled by default (Chrome 111)
Intent stage
None

Summary

Extend :nth-child(an + b) to take a selector, and the same with :nth-last-child. So e.g. :nth-child(3 of .c) is the third .c under a given parent. (This is not the same as .c:nth-child(3), which is a .c that must also be the third element under a given parent.)

Standards & signals

View on chromestatus.com