On this page
  1. min()
  2. Syntax & Overview
  3. Notes & Best Practices
  4. Example

min()

Prev: `clamp()` | Up: math | Next: `minmax()`
Rel: math, Math & Sizing Functions Guide
Ref: MDN Web Docs — min()
Tags: #public #web #css #functions #math #tier/core


Syntax & Overview

min(100% - 2rem, 72rem)  /* + max() */

Selects the smallest (or largest with max()) value from a comma-separated list.

Notes & Best Practices

Example

.container {
  width: min(72rem, 100% - 2rem);
  margin-inline: auto;
}

Linked from

Related notes