Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> .grid-box1 { grid-area: 1 / 1 / 2 / 2; } .grid-box2 { grid-area: 1 / 2 / 2 / 3; } .grid-box3 { grid-area: 1 / 3 / 2 / 4; } .grid-box4 { grid-area: 2 / 1 / 3 / 2; } .grid-box5 { grid-area: 2 / 2 / 3 / 3; } .grid-box6 { grid-area: 2 / 3 / 3 / 4; } .grid-container { display: grid; grid-auto-rows: 100px; grid-gap: 10px; background-color: #1c87c9; padding: 10px; } .grid-container > div { background-color: #eee; text-align: center; padding: 20px 0; font-size: 25px; } </style> </head> <body> <h2>Grid property example</h2> <div class="grid-container"> <div class="grid-box1">1</div> <div class="grid-box2">2</div> <div class="grid-box3">3</div> <div class="grid-box4">4</div> <div class="grid-box5">5</div> <div class="grid-box6">6</div> </div> </body> </html>