Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
anilakar
on Aug 15, 2023
|
parent
|
context
|
favorite
| on:
CSS Selectors: A Visual Guide
You can make nth-child repeat by using an arithmetic expression inside the parentheses, like nth-child(3n). They also stack, so you can create pseudorandom transformations to a sequence of elements by adding styles for the first few prime numbers.
rafram
on Aug 15, 2023
[–]
Or nth-child(even), or nth-child(odd). (Keeping in mind that children are 1-indexed in CSS.)
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: