CSS grid-auto-rows Property

❮ Previous Reference Next ❯

Example

.grid-container {
  display: grid;
  grid-auto-rows: 150px;
}





1
2
Hello World!
3
4
5
6

Meaning

The grid-auto-rows property specifies the size of an implicitly-created grid row track or pattern of tracks.

Default value:auto
Inherited:No
Animatable:Yes
Version:CSS Grid Layout Module Level 1
JavaScript syntax:
object.style.gridAutoRows="auto|max-content|min-content|length|initial|inherite|revert|revert-layer|unset";



Standard Syntax

grid-auto-rows: auto|max-content|min-content|length|initial|inherite|revert|revert-layer|unset;



Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







Property Values

The following table describes the values of this property.

Value Description
auto This is default value. Specifies that the size of the rows is determined by the size of the largest item in the row.
max-content Specifies that the size of each row to depend on the largest item in the row.
min-content Specifies that the size of each row to depend on the largest item in the row.
length Specifies that the size of the rows, by using a legal length value.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element animation-delay property.
revert Reverts the cascaded value of the property from its current value to the value the property
revert-layer Rollback styles to the ones specified in previous cascade layers.
unset Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.



Default CSS Property Values

selectors {
  grid-auto-rows: auto;
}



More Example



1
2
3

Example

.grid-container {
  display: grid;
  grid-template-rows: 50px;
  grid-auto-rows: 100px;
}
❮ Previous Reference Next ❯