Encyclopedia / CSS

Responsive design

One page that adapts to every screen.

Start from the phone and add media queries as screens get wider. Fluid units (%, rem, clamp()) and the viewport meta tag do most of the work. Google indexes the mobile version first, so the phone layout is the one that counts most for search.

@media (min-width: 768px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

Related terms

Layout (Flexbox & Grid) Core Web Vitals

More in CSS

How the document looks at every screen size.

CSS Layout (Flexbox & Grid) Design tokens Web fonts

Open in the interactive encyclopedia →