Input
Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS Grid Template Areas Example</title> <style> * { box-sizing: border-box; margin: 0; padding: 0; } html, body { height: 100%; } .container { display: grid; height: 100vh; grid-template-columns: 200px 1fr; grid-template-rows: 100px auto 50px; grid-template-areas: "header header" "sidebar content" "footer footer"; gap: 10px; padding: 10px; background-color: #f0f0f0; } .header { grid-area: header; background-color: lightblue; display: flex; align-items: center; justify-content: center; } .sidebar { grid-area: sidebar; background-color: lightgreen; display: flex; align-items: center; justify-content: center; } .content { grid-area: content; background-color: lightcoral; display: flex; align-items: center; justify-content: center; } .footer { grid-area: footer; background-color: lightyellow; display: flex; align-items: center; justify-content: center; } </style> </head> <body> <div class="container"> <div class="header">Header (100px)</div> <div class="sidebar">Sidebar (200px)</div> <div class="content">Main Content (Flexible)</div> <div class="footer">Footer (50px)</div> </div> </body> </html>