Full page layout — header + sidebar + main + footer
The classic dashboard layout: fixed header on top, sidebar on left, main content fills the rest, footer at bottom.
CSS Grid is the best tool for full-page layout. grid-template-areas gives each section a NAME, then you assign elements to areas. 'header header' — header spans 2 columns. 'sidebar main' — sidebar left, main right. 'footer footer' — footer spans 2 columns. grid-template-columns: 200px 1fr — sidebar is fixed 200px, main takes the rest (1fr = 1 fraction). grid-template-rows: auto 1fr auto — header/footer size to content, main fills the remaining height. min-height: 100vh — body is at least the full viewport height, so the footer stays at the bottom even on short pages. This pattern: header/sidebar/main/footer is the skeleton of almost every web app.
-
Change grid-template-columns: 200px 1fr to 250px 1fr→ sidebar becomes wider -
Change 200px to 0 (and set sidebar to display: none)→ sidebar disappears — main takes full width -
Change the grid-template-areas to put sidebar on the right: "header header" "main sidebar" "footer footer"→ sidebar moves to the right side -
Change min-height: 100vh to min-height: 200vh→ page becomes very tall — you can scroll