Nth Child

li:nth-child(<index>)

li:nth-child(even) = start at 0, add 2 each time (0, 2, 4, 6)

li:nth-child(odd) = start at 1, add 2 each time (1, 3, 5, 7)

li:nth-child(3n) = start at 0, add 3 each time (0, 3, 6)

li:nth-child(3n + 1) = start at 1, add 3 each time (1, 4, 7)

li:nth-child(3n - 1) = start at -1, add 3 each time (-1, 2, 5, 8)

li:nth-child(-3n + 4) = start at 4, minus 3 each time

Nth Last Child

li:nth-last-child(<index>)

li:nth-last-child(even) = start at 8, minus 2 each time (8, 6, 4, 2, 0)

li:nth-last-child(odd) = start at 7, minus 2 each time (7, 5, 3, 1, -1)

li:nth-last-child(3n) = start at 8, minus 3 each time (8, 5, 2, -1)

li:nth-last-child(3n + 1) = start at 7, minus 3 each time (7, 4, 1, -2)

li:nth-last-child(3n - 1) = start at 9, minus 3 each time (9, 6, 3, 0)

li:nth-last-child(-3n + 4) = start at 4, minus-minus 3 (+3) each time (4, 7)

Nth Child Type Selectors

:nth-child(<index> of p)

One

div1

Two

div2

Three

div3

Four

div4

Five

div5

Six

div6

Seven

div7
p:nth-child(<index>)

One

div1

Two

div2

Three

div3

Four

div4

Five

div5

Six

div6

Seven

div7
:nth-child(<index> of p)

One

div1

Two

div2

Three

div3

Four

div4

Five

div5

Six

div6

Seven

div7
:nth-child(even of p.highlight)

One

div1

Two

div2

Three

div3

Four

div4

Five

div5

Six

div6

Seven

div7