minmax()

noun

say it: “MIN-maks” /ˈmɪnmæks/

A CSS function that gives a grid row or column a smallest and a largest size, such as minmax(200px, 1fr): never under 200 pixels, and free to grow.

What does minmax() do?

minmax() gives a track a smallest and largest size, so it can flex between them.

.cards { display: grid; grid-template-columns: repeat(3, minmax(200px, 1fr)); }

In a sentence

  • “Each column is minmax(180px, 1fr), so the bike cards never get too thin.”

Level: Journeyman · More CSS terms at this level

Updated