/* HTML structure:
*/
.grid-container {
display: grid;
grid-template-columns: 200px 1fr 150px; /* Sidebar, Content, Ads */
grid-template-rows: auto 1fr auto; /* Header, Main Area, Footer */
grid-template-areas:
"header header header"
"sidebar content ads"
"footer footer footer";
gap: 10px; /* Gutter between grid items */
min-height: 100vh; /* Example: Full viewport height */
}
.header { grid-area: header; background-color: #f0f0f0; padding: 20px; text-align: center; }
.sidebar { grid-area: sidebar; background-color: #e0e0e0; padding: 20px; }
.content { grid-area: content; background-color: #d0d0d0; padding: 20px; }
.ads { grid-area: ads; background-color: #c0c0c0; padding: 20px; }
.footer { grid-area: footer; background-color: #b0b0b0; padding: 20px; text-align: center; }
@media (max-width: 768px) {
.grid-container {
grid-template-columns: 1fr; /* Single column layout */
grid-template-rows: auto auto 1fr auto auto; /* Header, Sidebar, Content, Ads, Footer */
grid-template-areas:
"header"
"sidebar"
"content"
"ads"
"footer";
}
}