--- url: "https://web.dev/articles/min-max-clamp" titulek: "CSS min(), max(), and clamp() | Articles | web.dev" h1: "CSS min(), max(), and clamp() Stay organized with collections Save and categorize content based on your preferences." popis: "Min, max, and clamp provide powerful CSS capabilities that enable more responsive styling with fewer liens of code. This post goes over how to control element sizing, maintain proper spacing, and implement fluid typography using these well-supported CSS math functions." jazyk: "en" kanonicka: "https://web.dev/articles/min-max-clamp" drobecky: ["Articles", "CSS min(), max(), and clamp()"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 00:04:16" znaku: 6956 slov: 973 kodovani: "iso-8859-2" sha256: "9efadc476375f57c8adbd09050e146b4646f74201e1f2092ce90891d4b716084" --- CSS min(), max(), and clamp() Stay organized with collections Save and categorize content based on your preferences. Learn how to control element sizing, maintain proper spacing, and implement fluid typography using these well-supported CSS functions. Una Kravets As responsive design becomes more nuanced, CSS is constantly evolving to give authors increased control. The [`min()`](https://developer.mozilla.org/docs/Web/CSS/min), [`max()`](https://developer.mozilla.org/docs/Web/CSS/max), and [`clamp()`](https://developer.mozilla.org/docs/Web/CSS/clamp) functions, now supported in all modern browsers, are among the latest tools in making authoring websites and apps more dynamic and responsive. You can use these functions to control element sizing and resizing, maintain spacing between elements, and create flexible and fluid typography. The math functions, `calc()`, `min()`, `max()`, and `clamp()` allow mathematical expressions with addition (+), subtraction (-), multiplication (*), and division (/) to be used as component values [CSS Values And Units Level 4](https://www.w3.org/TR/css-values-4/#calc-notation) Browser support `min()` Browser Support 79 79 75 11.1 [Source](https://developer.mozilla.org/docs/Web/CSS/Reference/Values/min) `max()` Browser Support 79 79 75 11.1 [Source](https://developer.mozilla.org/docs/Web/CSS/Reference/Values/max) `clamp()` Browser Support 79 79 75 13.1 [Source](https://developer.mozilla.org/docs/Web/CSS/Reference/Values/clamp) Usage You can use `min()`, `max()`, and `clamp()` on the right side of any CSS expression where it would make sense. For `min()` and `max()`, you provide an argument list of values, and the browser determines which one is the smallest or largest. For example, in the case of `width: min(1rem, 50%, 10vw)`, the browser calculates which of these relative units is the smallest and uses that value for the element's width. The min() function selects the minimum value from a list of options in this [Codepen demo.](https://codepen.io/una/pen/rNeGNVL) The `max()` function does the same thing for the maximum value. The max() function selects a value from a list of options in this [Codepen demo.](https://codepen.io/una/pen/RwaZXqR) To use `clamp()`, enter three values: a minimum value, an ideal value to calculate from, and a maximum value. The clamp() function keeps its value between the specified minimum and maximum in this [Codepen demo.](https://codepen.io/una/pen/bGpoGdJ) You can use these functions anywhere a ``, ``, ``, `