Type any nth-child formula and see which elements get selected instantly.
The :nth-child() selector matches elements based on their position among siblings. It accepts a formula using the pattern An+B, where A is the cycle size, n is a counter starting at 0, and B is the offset. It is one of the most powerful CSS selectors for styling lists, tables, and grids without adding extra classes.
Zebra striping tables — tr:nth-child(odd)
First item styling — li:nth-child(1)
Last three items — li:nth-last-child(-n+3)
Every 4th grid item — .card:nth-child(4n)