Home
CSS
CSS Grid Container
Tryit: The grid-template-rows 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; grid-template-rows: 80px 200px; gap: 10px; background-color: dodgerblue; padding: 10px; } .grid-container > div { background-color: #f1f1f1; color:#000; padding: 10px; font-size: 30px; text-align: center; } </style> </head> <body> <h1>The grid-template-rows Property</h1> <p>Use the <em>grid-template-rows</em> property to specify the size (height) of each row.</p> <p>Notice that the first row in this grid is 80px high, the second row is 200px high, and the third row is 80px (and if a fourth row had been added, it would have been 200px high):</p> <div class="grid-container"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> </div> </body> </html>