HTML/CSSAdvanced#css#functions#responsive

What is the difference between min(), max(), and clamp() in CSS?

min() picks the smallest of its arguments, max() the largest, and clamp(min, preferred, max) locks a value between a floor and ceiling while preferring a fluid value in between — great for fluid typography without media queries.

Example
h1 { font-size: clamp(1.5rem, 4vw + 1rem, 3rem); }
.container { width: min(90%, 1200px); }

Related Questions

1
HTML/CSSBeginner#css#overflow

What is the difference between overflow: visible, hidden, scroll, and auto?

Open
2
HTML/CSSIntermediate#css#units

What is the difference between em and rem when nesting components?

Open
3
HTML/CSSIntermediate#css#variables

How would you implement a dark mode toggle using CSS?

Open