CSS grid-auto-rows Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The grid-auto-rows property sets the size of implicitly created row tracks. Implicit rows appear when items need more rows than grid-template-rows defines—for example with the default grid-auto-flow: row, or when an item is placed past the last explicit row.

It is set on the grid container, is not inherited, and the initial value is auto. Explicit rows from grid-template-rows are unchanged. For implicit columns, use grid-auto-columns.

Standard-track.

Not deprecated and not experimental. Baseline Widely available. Part of modern CSS Grid Layout.

CSS Syntax

syntax.css
grid-auto-rows: <track-size>+ | initial | inherit;

A track size can be auto, a length, a percentage, fr, minmax(), min-content, max-content, or fit-content().

Property Values

ValueDescriptionTry it
autoDefault. Size from content (similar to a flexible min/max content range)Try it
<length>Fixed height such as 60pxTry it
<flex>Share leftover space, such as 1frTry it
minmax()Clamp between a minimum and maximum sizeTry it
initialResets to autoTry it
inheritTakes the parent’s grid-auto-rowsTry it

You can list several sizes to repeat a pattern across successive implicit rows.

How to Use grid-auto-rows

Create a grid that needs extra rows, then size those extras on the container.

  1. Set display: grid on the container.
  2. Cause implicit rows: keep grid-auto-flow: row (default) with more items than fit, or place an item past the explicit rows.
  3. Set grid-auto-rows to the height you want for those new rows.
  4. Keep planned rows in grid-template-rows; this property does not replace that list.
PieceRequired?Role
Grid containerYesdisplay: grid on the parent
Implicit rowsYesWithout extra rows, the property has nothing to size
Track sizeYesauto, length, fr, minmax(), and related values

Live Preview

Three fixed columns and default row flow. Six items create two implicit rows. Only grid-auto-rows changes.

Items fill across each row, then wrap. Those new rows use grid-auto-rows.

Sample
1
2
3
4
5
6

grid-auto-rows: 60px

CSS Examples

Each snippet focuses on grid-auto-rows. Use Try It Yourself for a live editor.

Example 1 — Fixed Implicit Rows

Give every auto-created row a fixed height.

CSS
<style>
  section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-auto-rows: 60px;
  }
</style>

<section>
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
</section>
Try It Yourself

How It Works

  1. Fix the columns. Three equal columns come from grid-template-columns.
  2. Flow by row. The default grid-auto-flow: row fills across, then starts a new row.
  3. Size new rows. grid-auto-rows: 60px makes each new row 60px tall.
  4. Count the rows. Six items need two rows. Both are implicit and use that 60px size.

Example 2 — Flexible fr Rows

Share leftover height evenly among implicit rows.

CSS
<style>
  section {
    display: grid;
    height: 200px;
    grid-template-columns: 1fr 1fr 1fr;
    grid-auto-rows: 1fr;
  }
</style>

<section>
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
</section>
Try It Yourself

How It Works

  1. Give the grid a height. height: 200px creates free space for fr to share.
  2. Same flow. Row auto-flow still creates two implicit rows.
  3. Use fractions. 1fr means each of those rows gets an equal share of free space.
  4. Compare with 60px. Fixed lengths stay constant; fr grows with the container.

Example 3 — minmax() Range

Keep implicit rows at least 40px tall, but allow them to grow.

CSS
<style>
  section {
    display: grid;
    height: 200px;
    grid-template-columns: 1fr 1fr 1fr;
    grid-auto-rows: minmax(40px, 1fr);
  }
</style>

<section>
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
</section>
Try It Yourself

How It Works

  1. Set a floor. The first argument, 40px, is the minimum row height.
  2. Set a ceiling preference. 1fr lets rows share remaining space up to that flexible size.
  3. Protect short content. Rows will not shrink below 40px when space is tight.
  4. Same idea as templates. minmax() works here just like in grid-template-rows.

Edge Cases & Pitfalls

If nothing changes, you may not be creating implicit rows.

implicit

Only sizes implicit rows

Tracks from grid-template-rows ignore this property. You need extra rows from flow or placement to see an effect.

flow

Column flow creates columns, not rows

With grid-auto-flow: column, overflow items make new columns. Use grid-auto-columns for those, or keep the default row flow.

fr

fr needs a definite container height

If the grid’s block size is indefinite, 1fr rows often collapse toward content size. Give the container a height when you want equal flexible rows.

pattern

Multiple values form a repeating pattern

grid-auto-rows: 40px 80px makes the first implicit row 40px, the next 80px, then repeats.

cols

Do not confuse with grid-auto-columns

This property is for rows only. Implicit column width is controlled by grid-auto-columns.

Browser Support

grid-auto-rows is a browser CSS property for CSS Grid. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

grid-auto-rows

Supported in Chrome 57+, Firefox 52+, Safari 10.1+, and Edge 16+. Internet Explorer does not support modern Grid.

97% Global support
Google Chrome 57+
Full support
Mozilla Firefox 52+
Full support
Apple Safari 10.1+
Full support
Microsoft Edge 16+
Full support
Opera 44+
Full support
Samsung Internet 6.2+
Full support
Internet Explorer No modern Grid
Not supported
grid-auto-rows Widely supported

Bottom line: Safe in current browsers. Use it when auto-flow or placement creates rows beyond grid-template-rows.

Key Takeaways

  • Role: size rows the grid creates automatically.
  • Not for templates. Explicit rows still use grid-template-rows.
  • Initial: auto. Not inherited.
  • Default row flow is the usual way those extra rows appear.

One line: grid-auto-rows is the height rule for rows the grid invents on the fly.

Frequently Asked Questions

It sets the size of row tracks that the grid creates automatically when items need rows beyond grid-template-rows.
The initial value is auto, which sizes each implicit row from its content.
grid-template-rows defines the explicit rows you plan. grid-auto-rows only sizes extra (implicit) rows created by placement or auto-flow.
With the default grid-auto-flow: row, overflow items create new rows. Placing an item on a row line outside the explicit template also creates implicit rows.
No. Rows listed in grid-template-rows keep those sizes. Only newly created rows use grid-auto-rows.
It is Baseline Widely available: Chrome 57+, Firefox 52+, Safari 10.1+, and Edge 16+. Internet Explorer does not support modern Grid. It is a browser CSS property, not a Node.js feature.

Next: grid-column

Set an item’s column start and end lines.

grid-column tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful