#css3 #nthchild #css #csstutorial #cssshorts #pseudoclass
Description for all used nth-classes :
1. :first-child : Select the first child element
2. :last-child : Select the last child element
3. :nth-child(even) : Selects all elements with even positions (2nd, 4th, 6th, 8th,..)
4. :nth-child(odd) : Selects all elements with odd positions (1st, 3rd, 5th, 7th, 9th,..)
5. :nth-child(1) : Selects the first element
6. :nth-child(2n) : Selects every element whose position is a multiple of 2 ( 2, 4, 6, 8, 10, ...)
7. :nth-child(2n+1) : Selects elements whose index is a multiple of 2
8. :nth-child(4n-1) : Selects elements whose index is a multiple of 4 then subtract 1 (3, 7, ...)
9. :nth-child(-n+2) : Selects elements starting from the 2nd position counting backwards n positions (i.e. -1+2 select the 1st position)