function
min() — CSS reference
Select the numerically smallest compatible argument. A percentage can be compared with a length in a length-percentage context. This caps a fluid width without requiring a separate max-width, but does not replace all sizing constraints.
Formal Syntax & Structure
css syntaxcss
min(<calc-sum>#)Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS math lab</title><style>body {margin:0} .sample {height:12px;background:#006050}.parent {width:300px} .sample {width:40px;margin-bottom:4px} #a {width: min(80%, 200px)} #b {width: min(30%, 200px)}</style><body><div class="parent"><div id="a" class="sample"></div><div id="b" class="sample"></div></div></body></html>