Home
CSS
CSS Grid Item
Tryit: The grid-row property
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> .grid-container { display: grid; grid-template-columns: auto auto auto; gap: 10px; background-color: dodgerblue; padding: 10px; } .grid-container > div { background-color: #f1f1f1; text-align: center; padding: 10px; font-size: 30px; } .item1 { grid-row: 1 / 4; } </style> </head> <body> <h1>The grid-row Property</h1> <p>Use the <em>grid-row</em> property to specify where to place an item.</p> <p>Item1 will start on row-line 1 and end before row-line 4:</p> <div class="grid-container"> <div class="item1">1</div> <div class="item2">2</div> <div class="item3">3</div> <div class="item4">4</div> <div class="item5">5</div> <div class="item6">6</div> <div class="item7">7</div> <div class="item8">8</div> </div> </body> </html>