Complete Guide to HTML5 Semantic Tags

Learn what semantic tags are, why they matter, and how to use them effectively!

What are Semantic Tags?

Semantic HTML tags are elements that clearly describe their meaning both to the browser and to the developer. Instead of using generic tags like <div> and <span>, semantic tags tell you exactly what their purpose is.

Example: Compare these:

<div id="header"> ... </div>

vs

<header> ... </header>

The second one is clearer — you know this section is the page header!

Why are Semantic Tags Important?

Common HTML5 Semantic Tags

Tag Description
<header> Defines a header for a page or section.
<nav> Defines navigation links.
<main> Specifies the main content of a document.
<section> Defines a standalone section of content.
<article> Specifies independent, self-contained content (like a blog post).
<aside> Contains content indirectly related to the main content (sidebar).
<footer> Defines a footer for a page or section.
<figure> / <figcaption> Used for images, diagrams, with captions.
<mark> Highlights important text.
<time> Represents dates/times.

Example Semantic Layout

Here’s a simple example of how semantic tags are used in a webpage layout:

<header>
  <h1>My Website</h1>
</header>

<nav>
  <ul>
    <li>Home</li>
    <li>About</li>
    <li>Contact</li>
  </ul>
</nav>

<main>
  <article>
    <h2>Blog Post</h2>
    <p>This is an article.</p>
  </article>

  <aside>
    <p>This is a sidebar.</p>
  </aside>
</main>

<footer>
  <p>© 2025 My Website</p>
</footer>

Key Tips When Using Semantic Tags