Page structure
Practice: structure your page
Reorganize the personal page with semantic landmarks and verify that every piece of content belongs in the right container.
15 minute lesson
Your page has content and links. Now give it a useful structure.
Start by placing the page title and navigation inside header:
<header>
<h1>Sam's web page</h1>
<nav aria-label="Primary">
<a href="index.html">Home</a>
<a href="about.html">About me</a>
</nav>
</header>
Wrap the unique page content in main:
<main>
<section>
<h2>About me</h2>
<p>I am learning how the Web works.</p>
</section>
<section id="learning">
<h2>What I am learning</h2>
<!-- your list goes here -->
</section>
</main>
Finish with a small footer:
<footer>
<p>Built while learning HTML.</p>
</footer>
Do not add an element because its name sounds useful. Add it because the content matches its meaning.
You probably do not need article or aside yet. That is fine. A smaller honest structure is better than a page filled with unnecessary containers.
Inspect the landmarks
Open the browser accessibility inspector if it is available. Look for banner, navigation, main, and contentinfo landmarks.
The HTML elements create those landmarks without extra ARIA roles.
Done when
Your page has one visible main, clear navigation, and no container you cannot explain.
Lesson completed