p:nth-of-type(odd) {
background: #cddc39;
color: #121212;
}
AsyoucanseefromFigure1.44,thisonlymatchesodd-numberedpelements,rather
thanodd-numberedchildren.
Figure 1.44. Selecting odd-indexed p elements with :nth-of-type(odd)
Similarly,using:nth-last-of-type(even)selectseven-numberedpelements,but
thecountbeginsfromthelastpelementinthedocument—inthiscase,item 18
(Figure1.45).
Selectors 61