- Home
- /
- Tutorials
- /
- HTML Tutorial
- /
- HTML Semantic Layout Tags
HTML Layout
HTML Semantic Layout Tags
Semantic layout tags name the parts of a page by their job: header, nav, main, article, aside, footer. A page built from them looks the same as one built from divs, but screen readers, search engines and the next developer can understand it at a glance.
Before HTML5, every part of a page was a <div> with a class like header or content. The tags below replace those with elements that carry meaning. Screen reader users can jump between them like chapters, which is why they are also called landmarks.
Common Semantic Layout Tags
| Tag | Description |
|---|---|
<header> | Represents the top section of a webpage or a section, often contains a logo, navigation, or introductory content. |
<nav> | Defines navigation links to other pages or sections. |
<main> | Represents the main content area unique to the page. |
<section> | Groups related content into a logical block, usually with a heading. |
<article> | Represents a self-contained piece of content that could stand alone (like a blog post or news article). |
<aside> | Defines content indirectly related to the main content, such as sidebars or ads. |
<footer> | Represents the bottom section of a page or section, usually containing copyright or contact info. |
<figure> & <figcaption> | Used to include images or diagrams with captions. |
Example: Basic Semantic Layout
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Semantic Layout Example</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
}
header, nav, main, aside, footer {
padding: 20px;
margin: 10px;
border-radius: 8px;
}
header { background: #4CAF50; color: white; }
nav { background: #f1f1f1; }
main { background: #fff; }
aside { background: #f9f9f9; }
footer { background: #333; color: white; text-align: center; }
</style>
</head>
<body>
<header>
<h1>My Website</h1>
<p>Welcome to my homepage</p>
</header>
<nav>
<a href="#">Home</a> |
<a href="#">About</a> |
<a href="#">Services</a> |
<a href="#">Contact</a>
</nav>
<main>
<article>
<h2>What is HTML5?</h2>
<p>HTML5 introduces semantic elements that make web pages more readable and structured.</p>
</article>
<section>
<h2>Why Use Semantic Tags?</h2>
<p>They help browsers, developers, and search engines understand the meaning of your content.</p>
</section>
</main>
<aside>
<h3>Related Links</h3>
<ul>
<li><a href="#">Learn HTML</a></li>
<li><a href="#">CSS Basics</a></li>
</ul>
</aside>
<footer>
<p>© 2025 My Website | All rights reserved.</p>
</footer>
</body>
</html>How to choose the right tag
<main>: the content that is unique to this page. Exactly one per page. See the main tag.<article>: content that would make sense on its own, like a blog post, a product card or a comment.<section>: a part of something bigger, with its own heading. If you cannot think of a heading for it, it is probably a<div>.<aside>: related extras, like a sidebar or a tip box.<header>and<footer>: the top and bottom of the page, or of an article.<nav>: the main blocks of navigation links, not every group of links.
When nothing fits, a plain <div> is fine. It is for styling and grouping when there is no meaning to express.
Browser Support
Chrome | Edge | Firefox | Safari | Opera | IE9+ |
|---|---|---|---|---|---|
| Yes | Yes | Yes | Yes | Yes | Yes |
Good to know
HTML Semantic Layout Tags exercises
The head of a page
Make a header with the main heading Book Club and the paragraph Read with us.
Result
Check your answer to see it here.
