The clamp() Function

This Heading Uses clamp()

The h2 font-size is set to clamp(1.5rem, 5vw, 3rem). It will never be smaller than 1.5rem or larger than 3rem.

This div uses clamp() for both font-size and width. The font-size is clamp(1rem, 2.5vw, 2rem) and the width is clamp(200px, 50%, 600px). Resize the browser window to see the effect.