{"id":374484,"date":"2022-10-26T05:58:20","date_gmt":"2022-10-26T12:58:20","guid":{"rendered":"https:\/\/css-tricks.com\/?page_id=374484"},"modified":"2022-10-26T05:58:21","modified_gmt":"2022-10-26T12:58:21","slug":"grid-row","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/g\/grid-row\/","title":{"rendered":"grid-row"},"content":{"rendered":"\n

The grid-row<\/code> CSS property is a shorthand that specifies the row grid lines where a grid item starts and ends in a grid layout, and does it in a single declaration.<\/p>\n\n\n\n

.grid-container {\n  display: grid;\n  grid-template-columns: repeat(4, 1fr);\n}\n\n.grid-item:nth-child(2) {\n  grid-row: 2 \/ 4; \/* Starts on the second row line and ends on the fourth row line *\/\n}<\/code><\/pre>\n\n\n\n

Because of CSS Grid\u2019s default auto-placement behavior, the second child element of the grid in this example would normally be placed in the first row of the grid\u2019s second column. But we declare a grid-row<\/code> and set it to align the grid item\u2019s starting edge with the second grid line and its ending edge with the fourth grid line which relocates the grid item.<\/p>\n\n\n\n\n\n\n\n

\"\"
Setting the location and the size of the second grid item using the CSS grid-row<\/code> property<\/figcaption><\/figure>\n\n\n

Constituent properties<\/h3>\n\n\n

As mentioned, the grid-row<\/code> property is a shorthand that combines two properties:<\/p>\n\n\n\n \t\t\n

\n
\n\n