By tag: css selector

CSS :nth-child selector with a grid

The :nth-child CSS selector (or pseudo-class) has a number of uses. We’ve looked at some basic CSS :nth-child selector techniques before. Now, we’re going to look at some examples with grids, using some of the same selector patterns and some different ones.



CSS :nth-child selector

The :nth-child CSS selector (or pseudo-class) can be pretty useful, for example to select odd and even rows in a table.

We apply a variety of styles to show some different effects.

Setting Up

The examples that follow use this HTML snippet: