Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Titre du document</title> <style> .box1 { grid-area: itemname; } .grid-container { display: grid; grid-template-areas: 'itemname itemname itemname itemname itemname'; grid-gap: 5px; background-color: #8ebf42; padding: 5px; } .grid-container > div { background-color: #eee; text-align: center; padding: 20px 0; font-size: 20px; } </style> </head> <body> <h2>Exemple de la propriété grid-area</h2> <div class="grid-container"> <div class="box1">1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <div>6</div> </div> </body> </html>