Display H1 (32px → 72px)
- Input
- min: 32px @ 320px viewport, max: 72px @ 1280px viewport
- Expected output
- font-size: clamp(2rem, 2.5vw + 1.25rem, 4.5rem);
Responsive main heading. Grows smoothly from mobile to desktop.
fluid typography CSS clamp
Fluid typography with `clamp()` is the technique of continuously scaling fonts between two viewport sizes without using media queries. The function accepts three parameters: minimum, preferred value (viewport expression) and maximum. The preferred value is calculated as the line passing through the two extreme points in the vw × px space.
Responsive main heading. Grows smoothly from mobile to desktop.
Subtle but perceptible improvement in reading comfort on large screens.
It's a CSS function that constrains a value between a minimum and a maximum. In the middle it accepts any CSS expression — typically `viewport-width + rem-constant` for fluid typography.
Yes, and it is very useful. Padding, margin, gap and width accept clamp. Fluid spacing eliminates the need for different variables per breakpoint — a single token scales between mobile and desktop.
No. That technique (10px base) is an old workaround. Use the "rem base" field in the calculator to inform what your project's actual base is. With a 16px base, 1rem = 16px.
font-size: clamp(1rem, 0.7512vw + 0.8239rem, 1.5rem);1rem1.5rem0.7512vw0.8239remCSS is generated locally in your browser.