Lesson 12 +10 XP

Page Structure

A web page is like a well-organized house. HTML has special tags to name each room!

The sectioning tags

  • <header>: the top of a page or section (logo, title, maybe a menu).
  • <footer>: the bottom (copyright, contact links).
  • <nav>: a block of navigation links.
  • <main>: the main content of the page (only one!).
  • <section>: a themed chunk of content.
  • <article>: a self-contained piece, like a blog post or a news story.
  • <aside>: side content, like a sidebar or related links.
  • <address>: contact info for a person or page.
  • <search>: marks a search area.

A sample layout

Code

html
<body>
  <header>
    <h1>My Blog</h1>
    <nav>
      <a href="home.html">Home</a>
      <a href="posts.html">Posts</a>
    </nav>
  </header>

<main>
    <article>
      <h2>My First Post</h2>
      <p>Today I learned about HTML!</p>
    </article>

<aside>
      <h3>About me</h3>
      <p>I love building websites.</p>
    </aside>
  </main>

<footer>
    <p>Copyright 2026</p>
  </footer>
</body>

Which one do I pick?

Ask yourself:

  • Is it the top? → &lt;header&gt;
  • Is it the bottom? → &lt;footer&gt;
  • Is it the most important middle part? → &lt;main&gt;
  • Does it stand alone like a blog post? → &lt;article&gt;
  • Is it a themed group? → &lt;section&gt;
  • Is it extra, related stuff on the side? → &lt;aside&gt;
  • Is it a menu of links? → &lt;nav&gt;

The generic div

&lt;div&gt; is the &quot;I have no special meaning&quot; box. Use it to group things for styling, but prefer the named tags when you can: they tell everyone what the content means.

hgroup

&lt;hgroup&gt; groups a main heading with related sub-headings.

Code

html
<hgroup>
  <h1>The Great Adventure</h1>
  <h2>Book One of Many</h2>
</hgroup>

Why semantics matter

When you use the right tag, you help:

  • Search engines understand your page.
  • Screen readers navigate it.
  • Other developers read your code.

Semantic HTML is like labeling boxes in your garage: everyone can find what they need!

TL;DR

  • &lt;header&gt; = top, &lt;footer&gt; = bottom.
  • &lt;nav&gt; = links, &lt;main&gt; = main content (once).
  • &lt;section&gt; = themed chunk, &lt;article&gt; = standalone piece.
  • &lt;aside&gt; = sidebar-ish extras, &lt;address&gt; = contact info.
  • &lt;div&gt; = generic box with no meaning.
  • Use the named tags: they tell everyone what things mean.