minmax() Function
minmax()
Function
The CSS Grid minmax()
function accepts two parameters:
- The first parameter is the minimum size of a row or column.
- The second parameter is the maximum size.
The grid must have a variable width for the minmax()
function.
If the maximum value is less than the minimum, then the maximum value is ignored and only the minimum value is used.
The function can be used in the values of the grid-template-rows
, grid-template-columns
and grid-template
properties.
.grid {
display: grid;
grid-template-columns: 100px minmax(100px, 500px) 100px;
}
Join the conversation