WDD4 - HTML: semantic elements and page structure
- I can explain why semantic HTML elements are used to structure a web page.
- I can identify the purpose of
<header>,<nav>,<main>,<footer>and<section>. - I can build a simple HTML page structure using the correct semantic elements.
- I can match each semantic element to its role on a page.
- I can place navigation inside
<nav>and the unique page content inside<main>. - I can use
<section>for a meaningful grouped part of the page, not just as a random box.
WDD3 planned page areas. WDD4 turns those areas into semantic HTML structure.
<nav> element in HTML?Key vocabulary
Semantic page structure
Why semantic elements matter
Semantic HTML tells the browser, search engines, assistive technologies and other developers what each part of a page means. A page made only from generic boxes can still appear on screen, but its structure is harder to understand. A page using <header>, <nav>, <main>, <section> and <footer> communicates the role of each area clearly.
Use for introductory content such as the site name, logo or main heading.
Use for the main set of links that lets the user move around the site.
Use for the unique content of this page. Do not put repeated site-wide navigation here.
Use for a meaningful group of related content, such as "Plan your visit" or "Animal profiles".
Use for closing content such as contact details, copyright or secondary links.
Element rules and common structure mistakes
A page should normally include only one <main> element, because it marks the single unique content area of that page. Having two would make it unclear which one a search engine or screen reader should treat as the page's primary content. <section> is not simply a renamed <div>: a <div> carries no meaning at all and is used only as a generic styling or layout box, while a <section> should represent one themed, self-contained group of content that would make sense as its own entry in a document outline, usually introduced by its own heading. If a group of elements exists only to apply CSS spacing or layout and does not represent a distinct topic, <div> is still the correct choice, not <section>. <nav> is reserved for major navigation blocks such as the main site menu, not for every single link on a page - one link inside a paragraph does not need to be wrapped in <nav>.
Worked examples
<header>
<h1>Meadows Wildlife Centre</h1>
</header>
<nav>
<a href="index.html">Home</a>
<a href="visit.html">Visit</a>
<a href="animals.html">Animals</a>
<a href="schools.html">Schools</a>
</nav>
<main>
<section>
<h2>Plan your visit</h2>
<p>Find opening times, prices and accessibility information.</p>
</section>
</main>
<footer>
<p>Contact Meadows Wildlife Centre</p>
</footer>
<nav> because they help users move between pages.<main> because it is the unique content of that page.<section>, ideally with its own heading.<!-- Weak: the element names do not explain the page areas -->
<div>Meadows Wildlife Centre</div>
<div>Home | Visit | Animals | Schools</div>
<div>Animal profile content</div>
<!-- Better: semantic elements describe the content -->
<header>Meadows Wildlife Centre</header>
<nav>Home | Visit | Animals | Schools</nav>
<main>
<section>Animal profile content</section>
</main>
Choose the best semantic element for each wireframe area: site title, main page links, workshop enquiry content, "How to prepare for your visit" content group, and contact details at the bottom.
- Site title:
<header> - Main page links:
<nav> - Workshop enquiry content: inside
<main> - How to prepare for your visit:
<section> - Contact details at the bottom:
<footer>
- Using elements for appearance. Semantic elements describe meaning. CSS controls appearance later.
- Putting everything in
<main>. Repeated navigation and footer content should sit outside main. - Forgetting
<section>. It is mandatory Higher content and should be taught as a meaningful content group. - Using
<section>as a random layout box. A section should group related content and usually have a heading. - Leaving tags unclosed. Opened elements should be closed in the correct order.
If asked why semantic elements are useful, say that they describe the purpose of each page area. If asked to implement structure, use the exact element names from the specification: <header>, <nav>, <main>, <footer> and <section>.
Task Set A - Core questions
<main> is correct?<section> is best?<section> tags purely to help with CSS layout, with no heading and no shared topic. What is wrong with this?Task Set B - Extension or homework
<main> elements: one for the animal photo and facts, one for a related-animals list. Explain why this breaks the semantic HTML rule, and suggest a better structure using <section> instead.<div> elements.File this in OneNote under:
Higher Computing Science > Web Design & Development > WDD4
Pacing warning: WDD4 was planned as double-scoped but lands on a Tuesday single. Keep the live lesson to the five semantic elements and one skeleton build. Push Task Set B to homework if needed.
Do not skip section: <section> is spec-mandated Higher content and should be taught explicitly here, not left as an aside.
Scope control: no CSS styling yet. CSS starts in WDD6; this lesson is HTML meaning and structure only.