Semantic HTML Explained: Tags, Examples, and Best Practices

  by Ian Hernandez
Semantic HTML Explained: Tags, Examples, and Best Practices thumbnail

The same word can mean different things in different places. “Cool” can describe a temperature or a shrug of agreement, depending on who says it and where. That’s semantics: how context gives words their meaning.

HTML has semantics, too. Some tags tell a browser exactly what kind of content they hold. Others say nothing at all. The difference matters more than most beginners expect: it shapes how screen readers, search engines, and AI systems understand your pages.

In this guide, we’ll define semantic HTML, list the elements you’ll actually use, walk through a before-and-after code example, and share the best practices that make your markup easier to read for humans and machines alike.

What Is Semantic HTML?

Semantic HTML is the practice of using HTML elements that describe the meaning of their content — like <article>, <nav>, and <footer> — instead of generic containers like <div> and <span>. Semantic tags tell browsers, search engines, screen readers, and AI systems what each part of a page actually is.

DreamHost Glossary

Semantic Markup

Semantic markup is a process of structuring HTML to emphasize the content’s meaning, rather than its appearance. This makes it easier for search engines and real users to understand the content.

Read More

A <div> is just a box. It renders fine, but nothing about it says “this is the navigation” or “this is the main article.” A semantic element carries that meaning in its name, so anything reading your page knows what it’s looking at without guessing.

If you’re brand new to HTML, start with our guide to learning HTML and come back — this article builds on the basics.

Is It “HTML5” or Just HTML?

Both, but “HTML” is the current name. HTML5 was the 2014 version of the language that introduced most of the semantic elements in this guide. Since then, HTML has become a “Living Standard” maintained by WHATWG: one continuously updated specification with no version numbers. That means there’s no “HTML6” on the way — the language just keeps evolving in place.

You’ll still see the phrase “HTML5 semantic elements” everywhere, and it’s not wrong — that’s the version that introduced <article>, <section>, <nav>, and friends. Just know that today they’re simply part of HTML, and browsers keep gaining support as the standard evolves.

HTML5 vs. semantic HTML5 comparison illustration

Semantic HTML Elements: The Essential List

Here are the semantic elements you’ll use most, and what each one is for:

TagWhat it meansUse it for
<article>A self-contained piece of content that would make sense on its ownBlog posts, news stories, product cards, comments
<section>A thematic grouping of content, usually with its own headingChapters of a page: features, testimonials, pricing
<header>Introductory content for a page or sectionLogos, site titles, taglines, top navigation areas
<footer>Closing content for a page or sectionCopyright lines, contact details, related links
<nav>A block of navigation linksMenus, tables of contents, breadcrumbs
<main>The dominant content of the page — use only one visible per pageThe article body, the product page content, the app’s working area
<aside>Content related to, but separate from, the main contentSidebars, pull quotes, “related posts” boxes
<figure>Self-contained media referenced by the contentImages, diagrams, charts, code snippets
<figcaption>A caption for its parent <figure>Image credits, chart explanations
<details>A widget the visitor can open and closeFAQ answers, spoilers, advanced options
<summary>The always-visible label for a <details> widgetThe question line of a collapsible FAQ
<time>A date or time, with a machine-readable formatPublish dates, event times, opening hours
<mark>Text highlighted for relevanceSearch-term matches, key phrases
<address>Contact information for a page or articleAuthor contact blocks, the page owner’s contact details (not just any street address in prose)
<hgroup>A heading grouped with a subtitle or tagline paragraphA title plus the paragraph right under it

Plenty of older elements are semantic, too. <table> means tabular data, <form> means user input, <h1> through <h6> mean headings in order of rank, with <h1> the top level. Those predate HTML5, but they follow the same principle: the tag’s name tells you what its content is.

Get Content Delivered Straight to Your Inbox

Subscribe now to receive all the latest updates, delivered directly to your inbox.

Semantic vs. Non-Semantic HTML: A Before-and-After Example

The fastest way to understand semantic HTML is to see the same page written both ways. Here’s a simple blog layout built entirely from <div> elements — often called “div soup”:

<div class="header">
  <div class="nav">...</div>
</div>
<div class="content">
  <div class="post">
    <div class="post-title">My First Post</div>
    <div class="post-date">July 7, 2026</div>
    <div class="post-body">...</div>
  </div>
  <div class="sidebar">...</div>
</div>
<div class="footer">...</div>

It works. It renders. But every element is an anonymous box: a machine reading this page learns nothing about what any part of it means. Now the same layout with semantic elements:

<header>
  <nav>...</nav>
</header>
<main>
  <article>
    <h1>My First Post</h1>
    <p>Published <time datetime="2026-07-07">July 7, 2026</time></p>
    <p>...</p>
  </article>
  <aside>...</aside>
</main>
<footer>...</footer>

Same page, same look. But now the structure explains itself. A screen reader can jump straight to <main> or list the links in <nav>. A search engine knows the <article> is the content that matters and can read the publish date from <time>. And the next developer who opens the file understands it at a glance.

Infographic showing how semantic HTML5 tags structure content, with header at the top, nav, section and article in the middle, aside on the right, and footer at the bottom

Why Semantic HTML Matters

Semantic HTML pays off in three big ways: accessibility, search visibility, and maintainability.

Accessibility

Screen readers navigate pages by landmarks: the regions that semantic elements create. A user can jump directly to the navigation, the main content, or the footer instead of listening to the whole page in order. Build your page from anonymous <div> boxes and those shortcuts disappear.

The web has a long way to go here: per WebAIM’s 2026 Million report, 95.9% of the top one million home pages had detected WCAG 2 failures. Semantic structure is one of the simplest, cheapest ways to be part of the fix. For inspiration, see our roundup of great web accessibility examples.

SEO and AI Visibility

Search engines parse your page’s structure to understand what it’s about and which parts matter. Semantic elements make that job easier: <main> and <article> point crawlers at your primary content, <nav> and <footer> help them tell the main content apart from repeated page furniture like menus and footers, and <time> gives them machine-readable dates. Clean semantics won’t rank a page by itself, but it removes guesswork from how your content gets indexed. It’s also a foundation for the rest of your SEO work.

The same logic now applies to AI. Tools like ChatGPT, Claude, and Google’s AI Overviews extract answers from web pages, and clearly structured markup makes your content easier to parse, quote, and cite correctly.

Maintainability and Future-Proofing

Semantic markup is self-documenting. Six months from now, <aside class="promo"> tells you far more than <div class="box3">. And because semantic elements are part of the HTML Living Standard, browsers will keep supporting and improving them, so your structure stays valid for years without rewrites.

Semantic HTML Tips and Best Practices

Four habits will get you most of the value:

1. Use the Right Tag for the Job

Before you reach for a <div>, ask whether a semantic element already describes what you’re building. Standalone piece of content? <article>. Group of navigation links? <nav>. A <div> is fine when nothing else fits — it’s the generic container of last resort, not the default.

2. Avoid Over-Nesting

Keep your structure as flat as the design allows. Wrappers inside wrappers inside wrappers make code hard to read and hard to maintain, and they usually signal that styling problems are being solved with markup instead of CSS.

Example of over-nested HTML elements with many redundant wrapper divs

3. Be Consistent Across Your Site

If blog posts are <article> on one page, they should be <article> everywhere. Consistent structure makes templates easier to maintain and gives assistive technology a predictable map of your site.

4. Let Native Elements Do the Accessibility Work

Native semantic elements come with accessibility behavior built in, so use them before reaching for ARIA (Accessible Rich Internet Applications) attributes — a <nav> element doesn’t need role="navigation" bolted on. Add descriptive alt text to images and meaningful link text, then check your work with testing tools like WAVE, axe, or Lighthouse.

Semantic HTML FAQs

What’s the difference between semantic and non-semantic HTML?

Semantic elements describe their content’s meaning (<article>, <nav>, <footer>); non-semantic elements are generic containers that say nothing about what’s inside (<div>, <span>). Both render the same content — only one explains it.

Is <div> a semantic element?

No. A <div> carries no meaning — it’s a generic box for grouping and styling. That doesn’t make it bad; it makes it a last resort. Use it when no semantic element fits what you’re building.

Does semantic HTML help SEO?

It helps search engines understand and index your content accurately, which supports your SEO — but it isn’t a magic ranking switch. Think of it as removing friction: clear structure makes your content easier to crawl, interpret, and feature.

What are the most commonly used semantic HTML elements?

The structural workhorses: <header>, <nav>, <main>, <article>, <section>, <aside>, and <footer>. Learn those seven and you can structure almost any page semantically.

Is HTML5 still the latest version of HTML?

There’s no “latest version” anymore. HTML is now a Living Standard, maintained by WHATWG and updated continuously without version numbers. HTML5 was the 2014 release that introduced most semantic elements, and the name stuck.

Build Your Semantically Structured, Accessible Website With DreamHost

Semantic HTML makes your site easier to understand for every reader — human, crawler, or AI. The markup only gets seen when your site is up, though, and that part is the host’s job.

DreamHost web hosting comes with a 100% uptime guarantee, unmetered bandwidth, and 24/7 expert support, so your well-structured pages are always there when visitors (and search engines) come looking.

Ian is a Product Designer based in Los Angeles, California. He is responsible for driving brand and product design at DreamHost, developing and maintaining our internal design system, and writing frontend code when he can. In his free time, he enjoys walking his dog, learning history, and discovering new music online and irl. Connect with him on LinkedIn: https://www.linkedin.com/in/ianhernandez23/