Quantity Queries for CSS

Avatar of Chris Coyier
Chris Coyier on

DigitalOcean provides cloud products for every stage of your journey. Get started with $200 in free credit!

Heydon Pickering with some clever CSS selectors like:

li:nth-last-child(n+6),
li:nth-last-child(n+6) ~ li {
  /* Selects all list items if there are 6 or more */
}

Similar to Matt Mastracci’s article where he focuses on styles for groups of specific numbers.

Direct Link →