Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Semantic HTML – The Structural Elements | HTML Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. HTML Course

Lesson 2 of 55

·HTML

Semantic HTML – The Structural Elements

9 min

Course progress4%

What you'll learn

Keep these ideas in mind as you work through the lesson.

5 points
  • Purpose of each structural element (`header`, `nav`, `main`, `section`, `article`, `aside`, `footer`)
  • How landmarks improve both screen‑reader navigation and SEO crawlability
  • When to use `<section>` vs `<article>`
  • Avoid nesting structural elements incorrectly
  • Best‑practice order of landmarks in the DOM

Semantic Structure (HTML5)

<header>
  <h1>My Portfolio</h1>
  <nav aria-label='Primary navigation'>
    <ul>
      <li><a href='index.html'>Home</a></li>
      <li><a href='projects.html'>Projects</a></li>
      <li><a href='contact.html'>Contact</a></li>
    </ul>
  </nav>
</header>
<main>
  <section aria-labelledby='about-heading'>
    <h2 id='about-heading'>About Me</h2>
    <p>…</p>
  </section>
  <article>
    <h2>Latest Blog Post</h2>
    <p>…</p>
  </article>
</main>
<aside>
  <h2>Related Links</h2>
  <ul>…</ul>
</aside>
<footer>
  <p>© 2026 Jane Doe</p>
</footer>

Landmarks explained

  • <header> – Introductory content, often contains logo and navigation.
  • <nav> – Primary navigation links. When multiple navs exist, give each an aria-label.
  • <main> – Main unique content; only one per page.
  • <section> – Thematic grouping; should start with a heading.
  • <article> – Self‑contained composition (blog post, news article).
  • <aside> – Tangential content such as sidebars or pull quotes.
  • <footer> – Author info, copyright, related links.

SEO & accessibility impact

  • Landmarks improve crawlability – search engines understand the page hierarchy.
  • Screen readers expose these regions in the Accessibility Tree, enabling quick jumps.
  • Keep the DOM order logical – header → nav → main → section/article → aside → footer.

Quick checklist for semantic layout

  1. One <header> at the top? ✅
  2. Navigation wrapped in <nav> with a clear label? ✅
  3. Exactly one <main> element? ✅
  4. Sections start with a heading (<h2>‑<h6>)? ✅
  5. <article> used for self‑contained content? ✅
  6. <aside> for complementary information? ✅
  7. <footer> placed at the bottom? ✅

Tip: Run your page through the WAVE tool – it highlights missing or mis‑used landmarks.

Make it stickPractice what you've learned1 quiz · 2 practical tests · Optional activities from HTML CourseBrowse activities
Previous lessonIntroduction to HTMLContinue to lesson 3HTML5 New Elements – Details & SummaryBack to HTML Course curriculum