CSS 3 · Responsive design

Scale a size fluidly

Keep a font size between a minimum and maximum, growing with the viewport.

h1 {
  font-size: clamp(1.75rem, 4vw, 3rem);
}

Official CSS 3 documentation

More responsive design commands

All responsive design commands · CSS 3 cheatsheet

Was this page helpful?