Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> .container { display: grid; padding-top: 10px; height: 250px; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: auto; background: #ccc; justify-items: first baseline; } .item { width: 50%; height: 50%; text-align: center; } .item1 { background: red; } .item2 { background: blue; } .item3 { background: green; } </style> </head> <body> <h2>Justify-items property example</h2> <div class="container"> <div class="item1 item">1</div> <div class="item2 item">2</div> <div class="item3 item">3</div> </div> </body> </html>