grid-template-rows

The grid-template-rows property defines the number and size of rows in a grid container.

Since CSS3 Spec ↗

Syntax

grid-template-rows: <track-size>...;  /* e.g. auto 1fr auto */

Examples

.page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
}
Output
Creates a sticky-footer layout where the middle row absorbs all extra vertical space.

Notes

Rows beyond the template are created implicitly and sized by grid-auto-rows. Use fr to distribute leftover height and auto to size to content.

Browser & runtime support

EnvironmentSince version
chrome 57
firefox 52
safari 10.1
edge 16

See also