Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
Instruction
:first-child and :last-child Pseudo-classes
CSS provides helpful pseudo-classes that select elements according to their position in the document, and their relation to other elements. In this step, you'll learn how to target first and last child elements using :first-child
and :last-child
.
Target a First Child Element
The :first-child
pseudo-class targets the first element among a group of sibling elements. For example, the ...