CSS min() Function

min() chooses the smallest value from multiple options.

Preview

Code

<style>
.box{
width:min(300px, 80%);
background:#f59e0b;
height:60px;
}
</style>

<div class="box"></div>

More CSS Math Functions Examples (8)