← Back to functions

CSS Function

max()

Math

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

Syntax

max(value1, value2, ...)

Example

padding: max(1rem, 3vw);

Common use cases

  • Ensuring a minimum size that scales with viewport
  • Responsive margins that never shrink below a threshold
  • Fluid layouts with lower bounds

Practical developer insight

max() ensures a value never drops below a certain floor — great for maintaining readability on very small screens.

Related