CSS Nth Selector Tester
Test bounded CSS :nth-child and related formulas against a fixed sample and see matching positions. No arbitrary CSS is executed.
Try :nth-child(2n+1), :nth-last-child(2), :nth-of-type(3), or :nth-child(odd). Only the Nth pseudo-class is evaluated.
Enter an Nth selector to highlight matching items.
divlidivlidivlidivliThe sample stays in this browser. The selector is parsed as a bounded formula and is never executed as CSS.
A QUICK WALKTHROUGH
How to use this tool
- Enter a supported Nth formula.
- Test it against the fixed sample.
- Read the highlighted positions.
Supported formulas
Supports :nth-child, :nth-last-child, :nth-of-type, and :nth-last-of-type with odd, even, an+b, or a single integer.
Safe local preview
Only a bounded formula parser runs; user text is never inserted into markup or executed as CSS.
GOOD TO KNOW
Common questions
Which formulas are supported?
The four supported Nth pseudo-classes accept odd, even, an+b, or a single integer.
What does :nth-child(2n+1) select?
It matches odd positions in the fixed sample.
Does the tester execute arbitrary CSS?
No. It parses only the supported formula syntax against a fixed sample.