Skip to content

Semantic HTML

In one line

Semantic HTML uses tags that convey the meaning and purpose of content, rather than just its appearance.

In simple words

Semantic HTML means using HTML tags that describe what the content IS, not just how it looks. Instead of using <div> for everything, you use <header>, <nav>, <main>, <article>, <section>, <footer>, and other tags that communicate the role of each part of the page.

Semantic HTML benefits accessibility (screen readers use it to navigate), SEO (search engines understand the page structure better), and developer communication (the code is self-documenting). It also enables browser features like reader mode.

The rule is simple: if a tag exists that describes your content's purpose, use it. Only fall back to <div> or <span> when no semantic tag fits.

Example

html
<article>
  <header>
    <h1>Blog Post Title</h1>
    <time>2026-01-15</time>
  </header>
  <p>Content here...</p>
  <footer>
    <p>Written by Ada</p>
  </footer>
</article>

Semantic tags describe the structure: article, header, time, and footer all convey meaning.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary