On this page9 sections
  1. Learning Objectives
  2. 1. What "Semantic" Means
  3. 2. The Layout Elements
  4. 3. A Full Page Layout
  5. 4. Section, Article or Div?
  6. Common Beginner Mistakes
  7. Practice Questions
  8. Practice Answers
  9. Key Takeaways

Lecture 023: Semantic Elements & Page Layout

Category4: Page Structure
Lecture023 of 048
Estimated video length14 min
TargetHTML5 · any modern browser
LevelBeginner

Most pages share the same shape: a header at the top, navigation, the main content, maybe a sidebar, and a footer. HTML has an element for each of these areas. They work like <div>s but also say what each area is.


Learning Objectives

  • Lay out a page with <header>, <nav>, <main>, <section>, <article>, <aside> and <footer>
  • Explain what "semantic" means and why it helps
  • Choose between <section>, <article> and <div>

1. What "Semantic" Means

Semantic means "having meaning". <div> says nothing about its content. <nav> says "these are the site's main links". Browsers, screen readers and search engines can use that meaning. For example, a screen reader can jump straight to <main>.


2. The Layout Elements

ElementUse it for
<header>Top of the page (logo, site name), or the top of an article
<nav>A block of main navigation links
<main>The page's main content. Only one per page
<section>A themed group of content, usually with its own heading
<article>Something that makes sense on its own: a blog post, news story, product
<aside>Side content: related links, tips, ads
<footer>Bottom of the page (copyright, contact), or of an article

3. A Full Page Layout

Example: the borders and labels are only there to show each area:

html
<style>
  header, nav, main, section, article, aside, footer { border: 1px dashed #999; margin: 6px; padding: 8px; }
</style>

<header>
  <h1>City Bakery</h1>
</header>

<nav>
  <a href="#">Home</a> · <a href="#">Menu</a> · <a href="#">Contact</a>
</nav>

<main>
  <section>
    <h2>Today's specials</h2>
    <article>
      <h3>Chocolate croissant</h3>
      <p>Buttery pastry with dark chocolate inside.</p>
    </article>
    <article>
      <h3>Banana bread</h3>
      <p>Soft, sweet and baked this morning.</p>
    </article>
  </section>

  <aside>
    <p>Tip: order before 10am for free delivery.</p>
  </aside>
</main>

<footer>
  <p>&copy; 2026 City Bakery</p>
</footer>

The areas stack on top of each other for now. In the CSS course you'll place the <aside> beside the content with Flexbox or Grid.


4. Section, Article or Div?

Ask these questions in order:

  1. Would it make sense on its own, shared or reposted somewhere else? → <article>
  2. Is it a themed part of the page with a heading? → <section>
  3. Is it just a box for styling? → <div>

Common Beginner Mistakes

1. More than one <main>. A page has a single main area.

2. <nav> around every link. Keep <nav> for major navigation blocks, not a single link inside a paragraph.

3. <section> without a heading. If you can't give it a heading, it's probably a <div>.

4. Expecting a layout from these elements. They describe meaning. Positioning comes from CSS.


Practice Questions

  1. What does "semantic HTML" mean?
  2. How many <main> elements should a page have?
  3. Which element holds a site's main menu?
  4. A blog post that could be shared on its own: <section> or <article>?
  5. Where would you put copyright text?
  6. Write the outline of a page with a header, a main area containing one section, and a footer.

Practice Answers

  1. Using elements that describe what the content is, not just how it looks.
  2. One.
  3. <nav>
  4. <article>
  5. In the <footer>.
  6. html
    <header><h1>My Site</h1></header>
    <main>
      <section>
        <h2>About</h2>
        <p>Welcome to my site.</p>
      </section>
    </main>
    <footer><p>&copy; 2026</p></footer>

Key Takeaways

  • Semantic elements name the areas of a page: header, nav, main, section, article, aside, footer.
  • They help screen readers, search engines, and you when you reread your code.
  • One <main> per page; <article> for stand-alone content; <section> for themed parts.
  • Use <div> only when no meaningful element fits.