Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Titre du document</title> <style> .box1 { grid-area: header; } .box2 { grid-area: menu; } .box3 { grid-area: main; } .box4 { grid-area: right; } .box5 { grid-area: footer; } .grid-container { display: grid; grid-template-areas: 'header header header header header header' 'menu main main main right right' 'menu footer footer footer footer footer'; grid-gap: 10px; background-color: #ccc; padding: 10px; } .grid-container > div { background-color: #eee; text-align: center; padding: 20px 0; font-size: 30px; } </style> </head> <body> <h2>Exemple de la propriété grid-template-areas</h2> <div class="grid-container"> <div class="box1">Titre</div> <div class="box2">Menu</div> <div class="box3">Principal</div> <div class="box4">Droite</div> <div class="box5">Pied de page</div> </div> </body> </html>