CSS grid-row property
Example
The following example sets "item1" to span two rows::
.item1
{
grid-row:
1
/
span
2
;
}
Try it »
Browser support
The numbers in the table indicate the first browser version that supports this property.
| property | |||||
|---|---|---|---|---|---|
| grid-row | 57 | 16 | 52 | 10 | 44 |
Property definition and usage
The grid-row property defines the start and end positions of a grid item's rows.
Note: grid-row is a shorthand property for grid-row-start and grid-row-end.
We can refer to line numbers to place grid items, or use the keyword "span" to define how many rows an item will span.
| Default value: | auto |
|---|---|
| Inherited: | no |
| Animatable: | support. Read about animatable Try it |
| Version: | CSS Grid Layout Module Level 1 |
| JavaScript syntax: | object.style.gridRow="2 / span 2" Try it |
Syntax
grid-row: grid-row-start / grid-row-end;
| Value | Description |
|---|---|
| grid-row-start | Specifies which row the grid item starts displaying at. |
| grid-row-end | Specifies the row where the grid item stops, or how many rows to span. |
More examples
The following example sets "item1" to start at row 1 and end before row 4:
Example
.item1
{
grid-row:
1
/
4
;
}
Try it »
Related Articles
CSS Tutorial: CSS Grid Layout