Sub topic 1
The four building blocks of a page
Most marketing and business pages follow the same plan. A visitor sees a header at the top, a hero right below it, a run of content sections, and a footer at the bottom. This chapter names each block, explains what it is for, and shows how each one maps to HTML. Later chapters build each block in detail.
Prerequisites
This chapter assumes you already know:
- Basic HTML tags and attributes, such as
<a href>and<img src alt>. - Basic CSS selectors and properties.
- How to open a page in a browser and inspect it with developer tools.
Why think in blocks
A page is easier to build and maintain when you split it into parts that each have one job. Visitors also benefit. They expect the site's identity at the top, the main message first, details next, and legal or contact links last. Matching that expectation makes a page feel familiar.
The four blocks
| Block | Job | Typical contents |
|---|---|---|
| Header | Say who the site is and help people move around | Logo or site name, navigation |
| Hero | Deliver the first message and ask for one action | Main heading, supporting sentence, call to action, image |
| Content sections | Support the message with detail | Headings, text, cards, lists |
| Footer | Close the page and offer secondary links | Copyright, privacy link, contact details |
A call to action (CTA) is a link or button that asks the visitor to do one specific thing, such as "See the menu".
Mapping blocks to HTML
Three of the blocks have their own HTML element. The header uses <header> and the footer uses <footer>. The hero and the content sections are both <section> elements, and they sit inside <main>, which holds the page's primary content. The hero has no element of its own. It is the first <section> in <main>, and a class such as hero identifies it for styling.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Acme Bakery</title>
</head>
<body>
<header>
<a href="/">Acme Bakery</a>
<nav aria-label="Primary">
<ul>
<li><a href="/menu">Menu</a></li>
<li><a href="/about">About</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section class="hero">
<h1>Fresh bread, baked every morning</h1>
<p>Order ahead and pick up warm loaves on your way to work.</p>
<a href="/menu">See the menu</a>
</section>
<section>
<h2>Our specialties</h2>
<p>Sourdough, rye, and seasonal pastries.</p>
</section>
</main>
<footer>
<p>© 2026 Acme Bakery</p>
<a href="/privacy">Privacy</a>
</footer>
</body>
</html>Read the skeleton from top to bottom and match each part to the table:
<header>holds the site name link and the primary navigation.- The first
<section class="hero">holds the one<h1>, a supporting sentence, and a single CTA. - The second
<section>is the first content section. It starts with an<h2>. <footer>holds the copyright line and a secondary link.
Identify the blocks on a real page
You can practice on any site. Open it in a browser, then open developer tools and inspect the Elements panel.
- Scroll to the top and find the element that holds the logo and links. That is usually a
<header>. - Find the first large heading and the button beside or under it. That is the hero.
- Collapse
<main>and look at its direct children. Each is usually a content section. - Scroll to the bottom and find the
<footer>.
Some sites use <div> elements instead of semantic ones. The blocks are still there. Only the element names are less helpful, which is the reason the next chapter covers semantic elements.
Common mistakes
- Putting the hero outside
<main>. The hero is part of the page's primary content. - Using more than one
<h1>. Give each page one<h1>, normally in the hero. - Treating the footer as an afterthought. Visitors who reach the bottom are often looking for contact details or privacy information.
- Packing several CTAs into the hero. One clear action works better than three competing ones.
Exercise
In the Acme Bakery skeleton, which element is the hero, and where does it sit in the page?
Show answer
The hero is the first <section> (the one with class="hero") and it sits inside <main>, after the <header> and before the other content sections. HTML has no dedicated hero element, so the class name marks it.
Exercise
Open any site you use and list which element or region you would call its header, hero, first content section, and footer. Note whether it uses semantic elements or <div>s.
Show answer
Answers vary. A good answer names the logo and navigation as the header, the first large heading with its button as the hero, the first block below the hero as a content section, and the bottom links as the footer. It also reports which tags the page uses, which you can read in the Elements panel.