Skip to content
Miraat·dweb developer journey, reflected

Semantic HTML

Using the right tags (header, nav, main, article…) instead of `div` everywhere.

Foundation 20 minutes Prerequisites: HTML Fundamentals

Key semantic tags

  • <header>: page or section header.
  • <nav>: primary navigation.
  • <main>: primary content (one per page).
  • <article>: self-contained unit (post, card).
  • <section>: thematic logical block.
  • <footer>: page or section footer.

Anti-pattern

<div class="header">…</div>   <!-- ❌ -->
<header>…</header>             <!-- ✅ -->

Use heading levels (h1h6) in hierarchical order, never skipping a level.

Recommended resources