CSS grid-template-rows Property


The grid-template-rows CSS property is used to specify the number of rows and row height in a grid. Grid-template-row values are space-separated, with each value representing the row's height.

Syntax

Example

Preview

Property Values

Value Description
none There is no set size. Rows are added as needed.
auto The size of the rows is determined by the container's size as well as the size of the items in the row's content.
max-content The size of each row is determined by the largest item in the row.
min-content The size of each row is determined by the smallest item in the row.
length Sets the row size by using a legal length value. Learn more about length units.

Supported Browsers

Property Chrome Firefox Safari Edge / IE Opera
grid-template-rows 57.0 52.0 10.0 16.0 44.0