Selecting Ranges of Elements with CSS

  1. List item example
  2. List item example
  3. List item example
  4. List item example
  5. List item example
  6. List item example
  7. List item example
  8. List item example
  9. List item example
  10. List item example
  11. List item example
  12. List item example
  13. List item example
  14. List item example
  15. List item example
  16. List item example
  17. List item example
  18. List item example
  19. List item example
  20. List item example

The selector li:nth-child(n+7):nth-child(-n+14) selects all items from 7 to 14, inclusive.
(Note that the selectors are reversed in the code to overcome a bug in Safari)

Credit: Gunnar Bittersman. Demo by Louis Lazaris. See article.