The grid-template-rows
CSS property defines the line names and track sizing functions of the grid rows. This defines the heights of rows.
#layout {
display: grid;
/* Three lines that define three rows of 100, 400 and 100px */
grid-template-rows: 100px 400px 100px;
}
/* Keyword value */
grid-template-rows: none;
/* <track-list> values */
grid-template-rows: 100px 1fr;
grid-template-rows: [linename] 100px;
grid-template-rows: [linename1] 100px [linename2 linename3];
grid-template-rows: minmax(100px, 1fr);
grid-template-rows: fit-content(40%);
grid-template-rows: repeat(3, 200px);
grid-template-rows: subgrid;
grid-template-rows: masonry;
/* <auto-track-list> values */
grid-template-rows: 200px repeat(auto-fill, 100px) 300px;
grid-template-rows: minmax(100px, max-content)
repeat(auto-fill, 200px) 20%;
grid-template-rows: [linename1] 100px [linename2]
repeat(auto-fit, [linename3 linename4] 300px)
100px;
grid-template-rows: [linename1 linename2] 100px
repeat(auto-fit, [linename1] 300px) [linename3];
/* Global values */
grid-template-rows: inherit;
grid-template-rows: initial;
grid-template-rows: unset;
Source: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows
The grid-template-columns
CSS property defines the line names and track sizing functions of the grid columns. This defines the widths of rows.
#layout {
display: grid;
/* Three lines that define three columns of 200, 500 and 200px */
grid-template-columns: 200px 500px 200px;
}
/* Keyword value */
grid-template-columns: none;
/* <track-list> values */
grid-template-columns: 100px 1fr;
grid-template-columns: [linename] 100px;
grid-template-columns: [linename1] 100px [linename2 linename3];
grid-template-columns: minmax(100px, 1fr);
grid-template-columns: fit-content(40%);
grid-template-columns: repeat(3, 200px);
grid-template-columns: subgrid;
grid-template-columns: masonry;
/* <auto-track-list> values */
grid-template-columns: 200px repeat(auto-fill, 100px) 300px;
grid-template-columns: minmax(100px, max-content)
repeat(auto-fill, 200px) 20%;
grid-template-columns: [linename1] 100px [linename2]
repeat(auto-fit, [linename3 linename4] 300px)
100px;
grid-template-columns: [linename1 linename2] 100px
repeat(auto-fit, [linename1] 300px) [linename3];
/* Global values */
grid-template-columns: inherit;
grid-template-columns: initial;
grid-template-columns: unset;
Source: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns
Important: rows go from left to right and columns from top to bottom in languages like English or Spanish, but for other languages, like Corean, rows will actually go from top to bottom, and columns will be horizontal.