HTML semantics is the practice of choosing elements that describe the meaning of each part of a document. Instead of nesting anonymous <div> boxes for every region, you mark the site banner, navigation, primary content, related sidebars, and page footer with purpose-built tags.
What is a semantic page layout?
A typical document outline uses <header> for introductory branding, <nav> for major links, a single <main> for the unique page content, optional <article> / <section> / <aside> groups inside that content, and <footer> for closing information. The visual look still comes from CSS—the tags communicate structure.
Why does semantics matter?
Screen readers and other assistive tools expose landmarks so people can jump to navigation, main content, or the footer. Search engines and browser features also gain clearer signals about what belongs where. Teammates reading your source understand the page faster than a wall of generic containers.
When should you use semantic layout tags?
Use them whenever a region has a clear role on the page. Reach for <div> only when you need a hook for layout or styling and no more specific element fits. Prefer a heading inside each <section> so the outline stays clear.
Meaning first, style second.
Semantic tags do not replace CSS grids or flexbox. They name the regions; CSS positions and paints them.
One <main> per page.
Keep a single visible main landmark. Nesting main inside header, nav, article, aside, or footer is invalid.
Landmarks help keyboard and AT users.
Native semantic regions create most landmarks automatically. You rarely need a custom role when the right HTML element already exists.
Nesting is flexible: <nav> often lives inside <header>, and <aside> can sit beside or after the main story. Choose tags for meaning; arrange them with CSS.
Reference
Core HTML Concepts
Elements you will use most often when structuring documents:
Element
Meaning
<header>
Introductory content for a page or a section (logo, title, local nav)
<nav>
Major navigation block—primary menus, table of contents, breadcrumbs
<main>
Dominant unique content of the document (one visible main)
<article>
Self-contained composition that could stand alone (post, card, comment)
<section>
Thematic grouping, usually with a heading, inside a larger page or article
<aside>
Content tangentially related to the surrounding material (tips, related links)
<footer>
Closing information for a page or section (copyright, contacts, meta links)
<div>
Generic container with no semantics—use for styling or script hooks only
Semantic vs non-semantic containers
Semantic (e.g. <main>)
Non-semantic (<div>)
Meaning
Describes role in the document
None by itself
Landmarks
Often creates an AT landmark
Only if you add ARIA roles
Best for
Page regions and content groups
Layout wrappers, CSS grids, JS targets
Approach
How to Structure a Semantic Page
A practical order that keeps meaning and accessibility aligned.
Sketch the regions first: banner, nav, main story, optional sidebar, footer.
Wrap the unique page content in one <main>.
Put site-wide links in <nav>; give multiple navs distinct aria-label values.
Use <article> for standalone pieces and <section> for headed themes.
Place tangents in <aside>—not every side column needs that tag.
Reserve <div> for anonymous layout boxes after the semantic outline is set.
Goal
Pattern
Site chrome
<header> + nested <nav>
Primary content
Single <main> wrapping the unique body
Blog post / news story
<article> with heading and optional sections
Themed block
<section> with a heading
Related tips / widgets
<aside> complementary to the main story
CSS grid / flex wrapper
<div class="…"> around semantic children
Try it
Live Preview
Switch layout patterns and compare how semantic regions appear versus a div-only shell.
Rendered sample with labels for each region. Div-only layouts look similar but lack native landmarks.
nav marks major site links as a navigation landmark.
aria-label names the landmark when a page has more than one nav.
header groups branding and primary links together.
Not every link list needs nav—reserve it for primary menus.
Example 3 — Article with Sections
HTML
<main>
<article>
<h2>Why semantic HTML helps</h2>
<section>
<h3>Accessibility</h3>
<p>Landmarks let assistive tech jump between regions.</p>
</section>
<section>
<h3>Maintainability</h3>
<p>Named regions make large templates easier to scan.</p>
</section>
</article>
</main>
Full document wires header, nav, main, article, section, aside, and footer.
Landmarks map to assistive technology jump targets.
Headings outline the article and complementary hours block.
Ready for CSS without renaming regions to anonymous divs.
Edge Cases & Pitfalls
Most layout bugs come from overusing divs or misplacing main and landmarks.
main
Multiple main elements
Only one visible main per document. Extra mains confuse landmarks and validators.
divitis
Wrapping everything in div
Anonymous boxes hide structure. Prefer semantic tags, then add div wrappers only for CSS.
nav
nav for every link list
Use nav for primary navigation. Footer social links or a single skip link usually do not need it.
section
Headless sections
A section should almost always include a heading. Without one, prefer a plain div.
aside
Aside ≠ any sidebar
Use aside for complementary content. A decorative layout column with primary content is not an aside.
aria
Redundant ARIA roles
Do not add role="main" on <main> or similar duplicates. Native elements already expose the landmark.
Compatibility
Browser Support
Semantic layout elements (header, nav, main, article, section, aside, footer) are part of HTML and work in all modern browsers.
✓ Baseline · Widely available
HTML semantics
Every current browser understands semantic sectioning and landmark elements for document structure.
100%layout elements
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
Semantic HTMLUniversal
Bottom line: Use header, nav, main, article, section, aside, and footer freely—pair them with CSS for visual layout.
Remember
Key Takeaways
Semantic tags name page regions so tools and people understand the layout.
One main wraps the unique content; header, nav, and footer frame the chrome.
article / section / aside organize stories, themes, and complementary notes.
div is for layout hooks when no semantic element fits—not a default wrapper.
One line: Build the outline with header, nav, main, article, section, aside, and footer, then add div only where styling needs a nameless box.
Frequently Asked Questions
Semantic HTML means choosing elements that describe meaning and role—not just appearance. Tags such as header, nav, main, article, section, aside, and footer tell browsers, assistive tech, and search tools what each region of the page is for.
Use article for a self-contained piece that could stand alone or be syndicated (a blog post, news story, or comment). Use section to group related content under a shared theme within a larger page—usually with a heading.
Use div when you need a generic box for layout or styling and no semantic element fits. Prefer header, main, nav, and similar tags when the region has a clear meaning. Avoid wrapping everything in divs by default.
One visible main per document. It marks the primary content unique to that page. Do not put main inside article, aside, header, footer, or nav.
Landmarks are named regions (banner, navigation, main, complementary, contentinfo, and others) that assistive technologies expose so users can jump by page area. Semantic layout tags create most of these landmarks automatically.
No. They can also wrap introductory or closing content inside article, section, or aside. The page-level banner and contentinfo landmarks usually come from header/footer that are not nested inside those sectioning elements.