minmax()
A CSS Grid function that lets a track size vary between a minimum and a maximum, such as minmax(280px, 1fr).
In more detail
It keeps tracks from becoming too narrow for their content while still letting them stretch to fill space. Combined with repeat() and auto-fit it builds responsive grids without media queries.
Related terms
- repeat() — A CSS Grid function that writes a track pattern many times, such as repeat(3, 1fr), or as many times as fit with auto-fit or auto-fill.
- auto-fit — A repeat() keyword that creates as many tracks as fit the container, then collapses empty ones so the filled tracks stretch to use the space.
- fr unit — A CSS Grid unit meaning one share of the space left after fixed-size tracks and gaps have been taken out.
- grid track — One row or one column of a CSS grid, the space between two neighbouring grid lines.
Taught in
- Advanced CSS Grid: Named Areas, minmax And auto-fit — Frontend Architecture & Web Platform