function

minmax() — CSS reference

Defines a lower and upper track sizing function, not a clamp on an individual item. A flexible fr value is permitted as the maximum, not the minimum. If the maximum is less than the minimum, it is effectively raised to the minimum. A zero minimum can allow a flexible track to shrink below content contributions.

Formal Syntax & Structure

css syntaxcss
minmax(<inflexible-breadth>, <track-breadth>)

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>minmax()</title><style>body{margin:0}#g{display:grid;width:300px;grid-template-columns:minmax(80px,1fr) 100px;}#g>*{background:#146e73;color:white;box-sizing:border-box}#b{background:#345d8e}#c{background:#79518e}</style><body><div id="g"><div id="a">A</div><div id="b">B</div></div></body></html>
CSS Reference