Useful :nth-child Recipes – CSS tricks

I get a little giddy when I come across perfect uses for :nth-child or:nth-of-type (read about the difference). The better you understand them, the more css nerdgasms you get to have!

In these simple “recipes” (really: expressions) I’ll arbitrarily use a flat list of list items and randomly chosen numbers. But it should be fairly obvious how to alter them to get similar selections.

Read more here: