Encyclopedia / CSS

CSS

The rules that decide how the page looks.

A selector picks elements, and declarations style them. The cascade decides which rule wins when several match: specificity, order, and @layer. Keep CSS in a file the browser can cache. It blocks rendering, so keep the critical part small.

.card {
  padding: 24px;
  border-radius: 12px;
  background: var(--surface);
}

Related terms

Layout (Flexbox & Grid) Design tokens Responsive design

Where it shows up in a page load

  1. Step 9: Style, layout, paint. CSS is applied to the DOM. The browser works out where every box goes (layout) and draws the pixels (paint). The moment the largest piece of content appears is called LCP, and it's one of Google's Core Web Vitals.

Watch the full request journey →

More in CSS

How the document looks at every screen size.

Layout (Flexbox & Grid) Responsive design Design tokens Web fonts

Open in the interactive encyclopedia →