Lazo Lab Sign up

Web Development / CSS

Lesson 9 of 30

Selectors

Select by tag (p), class (.card), id (#top) or combine them. Classes are the everyday choice because you can reuse them.

Key points

  • .class for reusable styles
  • #id for one unique element
  • a:hover for states
.card { padding: 16px; }
.card:hover { border-color: gold; }
Watch a video on thisOpens YouTube search results for “Selectors” in a new tab

Quiz · +10 XP

Which selector targets elements with class="card"?

Log in to save progress and earn XP.