Skip to content
Clairos Learn

CSS basics · Lesson 1 of 12 · 7 minutes

CSS basics: Element selectors

An element selector applies declarations to every matching element in its scope.

Mastery 0/3Run itExplain itApply it
Web workshopInert preview · code inspection

Current edit

PreviewNo external resources

Understand the pattern

An element selector applies declarations to every matching element in its scope.

An element selector applies declarations to every matching element in its scope.

Misconceptions to reject

  • If the page fits one desktop viewport, no narrower viewport needs checking.
  • Hiding all overflow always makes content accessible.

The preview is a sanitized subset, not a full browser compatibility test.

Worked example and expected result
p { color: #182b2a; }
p { line-height: 1.6; }
h1 { font-size: 2rem; }

An element selector applies declarations to every matching element in its scope.

Try a variation

Adapt the final example to a different project name while retaining its structure and relationships. A different context still needs a real browser and accessibility check.

Explain it

Which statement correctly explains element selectors?

Apply it elsewhere

You reuse element selectors in a different project. What must still be verified?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: CSS basics: Class selectorsTry an incident drill

Anonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.

Keep learning

  1. 01CSS basics: Class selectorsA class selector targets an intentional reusable hook rather than every element of a type.Practice
  2. 02CSS basics: Color tokensCustom properties centralize reusable values; var() reads a token and can provide a fallback.Practice
  3. 03CSS basics: Readable typographyFont size, line height, and line length work together. Line height without a unit scales with the text.Practice