clamp()
clamp() is a CSS function in the Functions category. Clamps a value between a minimum and maximum. The syntax is clamp(<min>, <preferred>, <max>). A typical example: font-size: clamp(1rem, 2.5vw, 2rem); It is commonly applied to markup such as <div class="demo">Sample</div> Browser support: Chrome 79+, Firefox 75+, Safari 12.1+, Edge 79+. A close relative is calc(), which performs mathematical calculations with mixed units. A close relative is min(), which selects the smallest value from a list. A close relative is max(), which selects the largest value from a list. More about this category: CSS functions — calc(), var(), clamp(), min(), max() and more. Related Functions entries: calc(), min(), max(), var(), env(), url(), attr(), rgb() / rgba(). This page is part of the free CSS Reference documentation covering 841+ properties, selectors, functions, and at-rules, each with syntax, values, examples, and browser support.