The grid-auto-rows property controls how tall automatically created grid rows become when your layout needs more rows than you explicitly defined.
01
Implicit
Auto rows.
02
auto
Default size.
03
px / rem
Fixed height.
04
minmax
Min & max.
05
fr
Flexible tracks.
06
Container
Grid parent.
Fundamentals
Introduction
The grid-auto-rows property in CSS is used to specify the size of rows in a grid container. When you create a grid layout, you may define explicit rows and columns, but any additional rows created by content will use the grid-auto-rows property to determine their size.
This property is essential for creating flexible and dynamic grid layouts that adapt to varying content sizes.
Definition and Usage
Set grid-auto-rows on a grid container alongside display: grid and grid-template-rows. Explicit rows come from your template; any extra rows the browser generates use the grid-auto-rows size. Pair with default row auto-flow when items wrap to new rows, or with explicit placement that extends beyond your template.
💡
Beginner Tip
If all items fit within your explicit row template, you may not notice grid-auto-rows. Add more items or fewer template rows to see implicit rows appear.
Foundation
📝 Syntax
The syntax for the grid-auto-rows property is straightforward. You can set it using length values, percentage values, or the auto keyword:
Each new item creates an implicit row at 5rem, giving a uniform vertical feed without setting a fixed number of rows.
A11y
♿ Accessibility
Do not clip important content when using fixed row heights; allow overflow or use minmax().
Ensure touch targets fit inside fixed-height rows on mobile devices.
Test zoom levels so text is not cut off in short rows.
Keep logical reading order when items wrap into new implicit rows.
Use headings inside cards rather than relying on row position alone.
🧠 How grid-auto-rows Works
1
Explicit rows are defined
grid-template-rows sets the planned row tracks.
Template
2
Extra rows are needed
Wrapping items or placement creates implicit rows beyond the template.
Implicit tracks
3
grid-auto-rows applies
Each new row uses the size you specified, such as 100px or minmax().
Sizing
=
▦
Consistent extra rows
Implicit rows stay uniform even as the grid grows vertically.
Compatibility
🖥 Browser Compatibility
The grid-auto-rows property is supported in most modern browsers, including recent versions of Chrome, Firefox, Safari, Edge, and Opera.
✓ Baseline · Modern browsers
grid-auto-rows everywhere
Implicit row sizing works in all major modern grid implementations.
97%Modern browser support
Google Chrome57+ · Desktop & Mobile
Full support
Mozilla Firefox52+ · Desktop & Mobile
Full support
Apple Safari10.1+ · macOS & iOS
Full support
Microsoft Edge16+ · 79+ Chromium
Full support
Opera44+
Full support
grid-auto-rows property97% supported
Bottom line: Safe for modern projects. Combine with display: grid and explicit row templates.
Wrap Up
🎉 Conclusion
The grid-auto-rows property is a powerful tool for web developers looking to create flexible and dynamic grid layouts. By controlling the size of automatically generated rows, you can ensure that your grid adapts to varying content sizes while maintaining a consistent and visually appealing layout.
Experiment with different values to see how this property can enhance the design of your web projects. Start with fixed pixels, then try minmax() and content keywords for smarter sizing.
grid-auto-rows sets the size of rows that are created automatically when grid items need more rows than grid-template-rows defines.
The default value is auto, which sizes implicit rows based on their content.
Explicit rows come from grid-template-rows. Implicit rows are generated when placement or auto-flow creates extra rows beyond those definitions.
grid-template-rows defines the main row tracks you plan for. grid-auto-rows only affects extra rows the browser creates when needed.
It applies when the grid creates implicit rows, such as when more items wrap to new rows or when items are placed on row lines beyond the explicit template.