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: left; } .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' 'left main main main right right' 'left footer footer footer footer footer'; grid-gap: 5px; background-color: #555; padding: 10px; } .grid-container > div { background-color: #ccc; text-align: center; padding: 30px 0; font-size: 30px; } </style> </head> <body> <h2>Exemple de la propriété grid-area</h2> <p>Vous pouvez utiliser la propriété grid-area pour nommes ler éléments de la grille.</p> <div class="grid-container"> <div class="box1">Header</div> <div class="box2">Left</div> <div class="box3">Main</div> <div class="box4">Right</div> <div class="box5">Footer</div> </div> </body> </html>