Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Der Titel des Dokuments</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>Ein Beispiel für Grid-area</h2> <p>Sie können die Eigenschaft grid-area verwenden, um Gitterelemente zu benennen.</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>