Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.


:nth-child() Pseudo-class

The :nth-child() pseudo-class targets elements based on their position within a parent element. :nth-child() uses a function-like syntax that accepts a value between the parentheses. The value is referred to as an argument.

We'll focus on two common arguments: the keywords odd and even. Both select every other child element based on an odd or even position.

Select Even Eleme...