CSS min, max, and clamp: pick a value from a range
Answer: You can use min, max, and clamp to control element sizing and create fluid typography.
Where they apply
Authors use them for element sizing, spacing, and fluid typography.
For min and max, you pass a list and the browser picks the smallest or largest.
clamp takes a minimum value, an ideal value, and a maximum value.
What each function returns
min returns the smallest computed value among the arguments you pass.
max does the opposite and yields the largest of those arguments.
clamp takes a minimum size, an ideal size, and a maximum.
See also
Claims
- id: C1 claim: These functions help with sizing, spacing, and fluid typography. source: S1 evidence: "maintain spacing between elements, and create flexible and fluid typography"
- id: C2 claim: clamp takes a minimum, an ideal, and a maximum. source: S1 evidence: "a minimum value, an ideal value to calculate from, and a maximum value"
- id: C3 claim: min returns the smallest computed value of its arguments. source: S2 evidence: "smallest computed value of the one or more passed arguments"
- id: C4 claim: clamp takes a minimum size, an ideal size, and a maximum. source: S2 evidence: "three arguments: the minimum size, the ideal size and the maximum"
Sources
- [S1] CSS min(), max(), and clamp(). web.dev. https://web.dev/articles/min-max-clamp . License: CC-BY-4.0. Accessed 2026-11-23.
- [S2] Functions. web.dev. https://web.dev/learn/css/functions . License: CC-BY-4.0. Accessed 2026-11-23.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: web.dev, CSS min(), max(), and clamp(); web.dev, Functions. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: web.dev, CSS min(), max(), and clamp(); web.dev, Functions. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0.
Cite this
iinventedlight. 2026. "CSS min, max, and clamp: pick a value from a range." iinventedlight Library, iil:note:f53h28ys, version of 2026-11-23. https://iinventedlight.com/library/notes/css-min-max-clamp/. License: CC-BY-4.0.
@misc{iil_note_f53h28ys,
author = {{iinventedlight}},
title = {{CSS min, max, and clamp: pick a value from a range}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-23},
url = {https://iinventedlight.com/library/notes/css-min-max-clamp/},
note = {Permanent ID iil:note:f53h28ys. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- css-min-max-clamp.schema.json (schema; CC-BY-4.0)
- css-min-max-clamp.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/css-min-max-clamp.md.