← Back to functions

CSS Function

min()

Math

Returns the smallest of a list of comma-separated values.

Syntax

min(value1, value2, ...)

Example

width: min(100%, 800px);

Common use cases

  • Capping width while keeping it responsive
  • Fluid typography with viewport units
  • Responsive padding that doesn't exceed a max

Practical developer insight

min() is perfect for responsive containers that should never exceed a maximum size — like a card that grows until 800px then stops.

Related