Grid Row Placement Property

Last updated: 2026-09-13

grid-row Grid Row Placement Property

grid-row is the shorthand for grid-row-start and grid-row-end. It positions a grid item along the vertical direction. By specifying the start and end grid-line numbers, you control how many rows the item spans. Together with grid-column, it gives precise control over an item’s position and size.

Category
Initial Valueauto
InheritedNo
Applies To
Animation Type
CSS VersionCSS3
StatusStandard

📝 Syntax

grid-row: <grid-line> [ / <grid-line> ]?;

⚙️ Values

ValueTypeDescription
<grid-line> / <grid-line>ValueGrid row placement

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
grid-row v57 v16 v52 v10.1 v44
Supported in all major browsers
Tip: grid-row: span 2 spans two rows, written the same way as grid-column.
Tip: Row lines are numbered from 1 at the top. Negative numbers count from the bottom, and -1 is the bottommost line.

❓ FAQ

QCan grid-row and grid-column be used together?
AYes. The two properties control the vertical and horizontal placement independently - they are orthogonal - and are often combined. For example grid-row: 1 / 3 with grid-column: 2 / 4 makes an item span two rows and two columns. When you only position one direction, the other uses auto placement. To set all four grid-line values at once, use grid-area.
QHow do I make a grid item extend automatically to the end?
AUse grid-row: 1 / -1 to span from the first row to the last. The -1 refers to the final grid line, so the item still ends at the last row even when the number of rows changes. Likewise grid-column: 1 / -1 makes an item span the full width of a row. Negative indexing is the most practical way to handle an unknown number of tracks in grid placement.
QCan I use grid-row: span 2 alone?
AYes. With only a span value, the start line defaults to auto and the browser places the item at the position chosen by the auto-placement algorithm, then extends it down two rows - good for lists with an unknown item count. To also control the start position, write grid-row: 2 / span 2, meaning start at line 2 and span two rows downward. The span form is more stable than a hard-coded end line when the lines are rearranged.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏