On this page9 sections
Lecture 023: Semantic Elements & Page Layout
| Category | 4: Page Structure |
| Lecture | 023 of 048 |
| Estimated video length | 14 min |
| Target | HTML5 · any modern browser |
| Level | Beginner |
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
| Element | Use 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:
<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>© 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:
- Would it make sense on its own, shared or reposted somewhere else? →
<article> - Is it a themed part of the page with a heading? →
<section> - 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
- What does "semantic HTML" mean?
- How many
<main>elements should a page have? - Which element holds a site's main menu?
- A blog post that could be shared on its own:
<section>or<article>? - Where would you put copyright text?
- Write the outline of a page with a header, a main area containing one section, and a footer.
Practice Answers
- Using elements that describe what the content is, not just how it looks.
- One.
<nav><article>- In the
<footer>. -
<header><h1>My Site</h1></header> <main> <section> <h2>About</h2> <p>Welcome to my site.</p> </section> </main> <footer><p>© 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.