The max() function returns the largest value among the provided arguments. It’s useful when you want to set a property value that needs to be a minimum threshold or larger.

Syntax:

CSS
width: max(300px, 50%);

Example:

This ensures that the width will be at least 300px, but if 50% of the container is larger than 300px, it will take that value instead:

CSS
div {
  width: max(300px, 50%);
}