header
Introductory content or page/site header.
Learn HTML Layout with practical examples for structure, layout semantics, metadata, embedded content, scripts, accessibility, SEO and live practice.
HTML structure and layout
A web page layout is not only columns and spacing. It is also the structure of the page: header, navigation, main content, sections, sidebars and footer.
HTML should describe those regions. CSS then decides whether they appear as one column, two columns, cards, grids or stacked mobile sections.
High-end layout starts with boringly clear structure. The visual polish comes later, but the HTML has to be strong first.
Introductory content or page/site header.
Major navigation links.
The primary content of the document.
Supporting content and closing information.
Syntax and structure
Use landmarks and sections for structure. Use CSS grid or flexbox for visual placement.
<header>Site header</header>
<nav aria-label="Main navigation">...</nav>
<main>
<section>
<h1>Page title</h1>
</section>
</main>
<footer>Site footer</footer>
<div class="top">...</div> <div class="left">...</div> <div class="middle">...</div> <div class="bottom">...</div>
Rules that matter
Layout-focused HTML is strongest when meaning, grouping, metadata and behavior hooks all have a clear reason to exist.
A page usually needs header, nav, main and footer before advanced layout.
The main element should represent the primary content of the page.
A section should normally have a heading and a real topic.
HTML should not become a table or div maze just to create columns.
Good structure stacks naturally when CSS changes layout.
Too many meaningless sections can be as confusing as too few.
Production thinking
This matters because layout is both structure and presentation. HTML provides the map; CSS makes it beautiful.
Landmarks help keyboard and screen reader users jump around a page quickly.
Layouts change often. Semantic regions survive redesigns better than class names such as left-column and right-column.
Clear page regions and heading structure make it easier to understand the main topic and supporting sections.
Live code lab
Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.
Mini assignment
Practice assignment
Try it yourself
Self-check
Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.