CSS

🎯 CSS grid-auto-rows Property

grid-auto-rows is a CSS Grid property that defines the default height of automatically created rows. When a grid item does not fit into existing rows, a new row is created, and its height is controlled by this property.

🔹 Values

1️⃣ auto

Row height is automatically adjusted based on content.

2️⃣ max-content

Row height expands to fit the maximum size of its content.

3️⃣ min-content

Row height shrinks to the minimum size required by content.

4️⃣ length (px, %, fr, rem)

You can define fixed or flexible row heights using units like px, %, or fr.

CSS

.grid {
    display: grid;
    grid-auto-rows: 100px;
}
                

5️⃣ initial

Resets the property to its default value.

  • 🧠 Quick Summary

  • grid-auto-rows defines the height of automatically created grid rows.
  • auto → height based on content.
  • min-content / max-content → content-based sizing.
  • length → fixed or flexible height.