Skip to content
Guest
Learn HTML · Course Syllabus Show lessons
Foundations · 8 min read · Beginner

Semantic HTML & Landmarks

Replace generic div soup with meaningful elements like header, nav, main, article, and footer for better accessibility and SEO.

What you'll learn

  • Choose semantic landmarks instead of generic <div> wrappers
  • Understand how screen readers and search engines use landmarks
  • Structure a complete article layout semantically

Semantic HTML means choosing the HTML element that accurately describes what the content is, not just how it looks.

Why Semantics Matter

  • Accessibility: Screen readers let users jump directly to <main>, <nav>, or <article> landmarks.
  • SEO: Search engines understand which part of your page is the primary content vs. navigation or footer boilerplate.
  • Maintainability: Reading <header> and <article> is far clearer than reading ten nested <div> tags.
✓ Use Semantic Landmarks
<header>
<nav>...</nav>
</header>
<main>
<article>
  <h1>Lesson Title</h1>
  <p>Readable content...</p>
</article>
</main>
<footer>© DevPath</footer>
✕ Avoid Div Soup
<div class="top">
<div class="links">...</div>
</div>
<div class="content">
<div class="post">
  <div class="big-text">Lesson Title</div>
  <div>Readable content...</div>
</div>
</div>
<div class="bottom">© DevPath</div>

Prefer native interactive elements too: use <button> for actions and <a> for navigation, never clickable <div> elements.

Try It Yourself

Explore how semantic elements create a clean, readable document skeleton:

Semantic Page Layout
Live Result

Check Your Understanding

Score: 0 / 1

1. Which element should wrap the dominant, unique content of a page?

Study Workspace

Finished this lesson?

Your progress is saved locally in your browser, no account needed.

Search courses, lessons, and references

Type to search across all courses, lessons, and quick references.

Press Esc to close Powered by Pagefind