CodeBlanks Logo Icon CodeBlanks

Home page

HTML course · Intermediate · Lesson 60/67

Write the hero and summary content sections for the home page.

Home page structure

The <main> region of the home page usually starts with a hero: an <h1> holding the page title and a short description paragraph. The content is then split into <section> regions.

Each section carries its own <h2> heading. Inside a section go <article> tags, which are self-contained content pieces; each article is written with <h3> and <p>. This keeps the heading hierarchy consistent across pages.

Section and article

A <section> groups related content and is introduced by an <h2> heading. Inside a section go <article> tags; each article is a self-contained piece with its own heading.

The Cheese Magazine home page has a 'Latest articles' section holding two articles: each has an <h3> (article title) and a <p> (short summary). This structure splits the page into meaningful regions for browsers and screen readers.

Exercise Add a hero and a section inside main

Add a <main> between the header and footer. Inside main put an <h1> (page title), a <p> (short description) and a <section>. Inside the section put an <h2> and at least two <article> tags; each article should have an <h3> and a <p>.

Show example solution
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Cheese Magazine</title>
  </head>
  <body>
    <header>
      <nav>
        <a href="/">Cheese Magazine</a>
        <a href="/articles">Articles</a>
        <a href="/about">About</a>
        <a href="/contact">Contact</a>
      </nav>
    </header>
    <main>
      <h1>Cheese Magazine</h1>
      <p>Articles, recipes and maker stories about cheese culture.</p>
      <section>
        <h2>Latest articles</h2>
        <article>
          <h3>Ezine cheese</h3>
          <p>We examined the production stages of Thrace's white cheese.</p>
        </article>
        <article>
          <h3>Van herb cheese</h3>
          <p>We met the herbs used in Eastern Anatolia's herb cheese.</p>
        </article>
      </section>
    </main>
    <footer>
      <address>
        Cheese Magazine, Brooklyn, NY
      </address>
      <p>(c) 2026 Cheese Magazine</p>
    </footer>
  </body>
</html>

Test yourself

  1. Complete the hero section heading

    <main><____>Cheese Magazine</h1></main>
    Show answer
    <main><h1>Cheese Magazine</h1></main>
  2. Which structure gives a section with an h2 and at least one article?

    • <h2><section><article>...</article></section></h2>
    • <section><article><h2>...</h2></article></section>
    • <section><h2>...</h2><article>...</article></section>
    • <section><h2>...</h2></section><article>...</article>
    Show answer

    <section><h2>...</h2><article>...</article></section> — Correct. A section starts with h2 and the article sits inside the section.

  3. Match the heading level to its role

    h1
    Page title
    h2
    Section heading
    h3
    Article heading
    section
    Content group

All lessons in Intermediate