1

Both CSS functions clamp the value between an upper and lower bound.

The only difference that I know is that minmax() can only be used in CSS grid.

user13397022
  • 107
  • 1
  • 5
  • 1
    Did you do some research on this ? quick look in the [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/clamp()) would tell you that clamp allows a middle value, minmax doesn't – Rainbow Jun 03 '21 at 12:43
  • 1
    I would say, they are completely different. The comparaison doesn't apply – Temani Afif Jun 03 '21 at 13:00

2 Answers2

1

From developer.mozilla.org:

clamp() enables selecting a middle value within a range of values between a defined minimum and maximum. It takes three parameters: a minimum value, a preferred value, and a maximum allowed value.

minmax() only accepts the two extreme values, plus the difference that you already mentioned.

biberman
  • 5,606
  • 4
  • 11
  • 35
1

minmax() may only be used in Grid and picks between two (2) parameters.

clamp() can be used anywhere in CSS and picks between three (3) parameters: minimum, preferred, and maximum, selecting the middle (preferred) parameter when possible.

clay
  • 1,757
  • 2
  • 20
  • 23