← All elements
<div class="hgl"><header>Header</header><nav>Nav</nav><main>Main content</main><aside>Aside</aside><footer>Footer</footer></div>About this layout
A header, footer, main area and two sidebars laid out with a few lines of grid, shown as a miniature page.
How it works
A single grid declares three rows and three columns with named areas for header, navigation, main, aside and footer. The middle row and column take the remaining space. The miniature can be resized from its corner to show that only the centre grows.
Ways to customise it
- Change the 58px side column widths.
- Adjust the 34px header and 30px footer rows.
- Add a media query that stacks the areas on narrow screens.
Good to know
It uses the matching semantic elements, which gives assistive technology useful landmarks. In a full page, use min-height on the body so the footer stays at the bottom.
Open an example, copy the HTML and the CSS, and paste them into your page. There is nothing to install and no JavaScript to load.