All subjects · Information Technology · WIT12 3 hour practical exam on web development with HTML, CSS and JavaScript

Semantic markup: structural elements, div and span

Edexcel IAL Information Technology · WIT12 3 hour practical exam on web development with HTML, CSS and JavaScript

Semantic markup describes what content **is**, not how it looks. Browsers, assistive technologies and search engines use that meaning (spec 11.1.1 to 11.1.3). Exam pages expect header, nav and footer elements, not divs named header.

Practise this in the app: instant marking and a fix for every mistake. Free, no email needed to start.

Practise this lesson

Why semantics matter (11.1.1)

Compare <div class="nav"> with <nav>. They can look identical, but only nav tells software what the content is:

Elements that define content (11.1.2)

<body>
  <header>
    <img src="images/logo.png" alt="Riverside Sports Centre">
    <nav>
      <a href="index.html">Home</a>
      <a href="classes.html">Classes</a>
    </nav>
  </header>
  <main>
    <section>
      <h2>This week's news</h2>
      <article>
        <h3>New pool opens</h3>
        <p>Our 25 metre pool opens on Monday.</p>
      </article>
    </section>
    <aside>
      <h2>Opening times</h2>
      <p>Every day from 7am.</p>
    </aside>
  </main>
  <footer>
    <p>Contact: info@example.com</p>
  </footer>
</body>
ElementMeaning
headerIntroductory content for the page or a section: logo, title, often navigation
navA block of major navigation links
mainThe main content of the page, unique to it; only one visible main per page
sectionA thematic group of content, normally with a heading
articleSelf-contained content that makes sense on its own and could be shared: a news story, blog post, product card, comment
asideContent related to, but separate from, the main content: a sidebar, related links, a fact box
footerFooter for the page or a section: copyright, contact details, related links

Grouping without a semantic element (11.1.3)

When no element has the right meaning, use the generic containers:

<div class="row">
  <p>Price: <span class="price">4.50</span></p>
</div>

Use a semantic element first; use div and span only when nothing fits.

Worked example

A page's code is `<div id="top">` containing the logo and links, `<div id="content">` for the story and `<div id="bottom">` for the copyright. Rewrite it semantically.

  1. The logo and links at the top are introductory: header, with the links inside nav.
  2. The story is the main content: main, and as a self-contained story, an article inside it.
  3. The copyright is footer content: footer.

Answer: header (with nav), main (with article) and footer replace the three divs.

Key idea: Semantic elements say what content is, which helps screen readers (landmarks), browsers, search engines and developers. header, nav, main, section, article, aside and footer define content; div (block) and span (inline) group content when nothing else fits.

Check yourself

  1. Which element should contain a self-contained blog post that would make sense on its own?
    • `<aside>`
    • `<article>`
    • `<nav>`
    • `<span>`
    Show answer

    `<article>`. article is for self-contained, independently distributable content.

  2. Which element suits a sidebar of related links beside the main story?
    • `<main>`
    • `<header>`
    • `<section>`
    • `<aside>`
    Show answer

    `<aside>`. aside is related but separate content.

  3. Explain how semantic elements such as nav and main help a screen reader user.
    Show answer

    The screen reader recognises them as landmarks, so the user can jump straight to the navigation or the main content instead of listening to the whole page.. Semantic elements become landmarks that assistive technology announces and lets users jump between.

  4. When should a div be used?
    • Always, instead of header and footer
    • Only inside a p element
    • When content needs grouping for styling or layout and no semantic element fits
    • For the main navigation links
    Show answer

    When content needs grouping for styling or layout and no semantic element fits. div has no meaning; use it only when nothing semantic fits.

  5. Which element marks the main content of a page, of which there should be only one visible per page? Type the element name.
    Show answer

    main. main contains the content unique to that page.

  6. A word inside a paragraph must be coloured red with no change of meaning. Which element should wrap it?
    • `<div>`
    • `<section>`
    • `<span>`
    • `<strong>`
    Show answer

    `<span>`. span is the generic inline container. strong would add the meaning 'important'.

  7. In a responsive page question, a candidate used `<div id="footer">` instead of a footer element. What did Pearson's examiners note about this?
    • It does not meet a requirement to use HTML5 semantic elements
    • It is preferred because ids are more specific
    • It is invalid HTML
    • It stops the CSS working
    Show answer

    It does not meet a requirement to use HTML5 semantic elements. The 2023 report noted candidates using divs named footer instead of HTML5 semantic elements.

Practise with instant feedback

Sources

Last updated 8 November 2026. Spotted a mistake? Tell us.