Back to CSS

CSS Tutorial

Selectors

Target HTML elements using element, class, id, and compound selectors.

Selectors tell the browser which elements should receive a style.

Common selectors include element selectors, class selectors, id selectors, and grouped selectors.

css
h1 {
  color: blue;
}

.card {
  padding: 24px;
}

#main-title {
  font-weight: 700;
}