Caffeinated Coder
Book an appointment
Lesson 02 · Styling basics

Selectors

A selector is the pattern at the start of a CSS rule that picks which elements the rule styles. Watch the browser test three rules against four elements: the type selector p reaches every paragraph, the class selector .new reaches every element with class="new", and the ID selector #top reaches the one element with id="top". Each rule then restyles only the elements it matched.

9 min9 steps5 questionsBeginner
Fig 2 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.