HTML Implementation (SQA National 5 Computing Science): Revision Note

Exam code: X816 75

Robert Hampton

Written by: Robert Hampton

Reviewed by: James Woodhouse

Updated on

HTML Implementation

Practical applications

  • In exam and assignment tasks students may be asked to:

    • Create the structure of a web page using HTML tags such as <html>, <head>, and <body>

    • Add headings and paragraphs using <h1>, <h2> and <p>

    • Insert images using <img> with a relative file path

    • Create navigation using hyperlinks with <a href="...">

    • Group content into sections using <header>, <main>, <section> and <footer>

    • Assign classes and IDs so that CSS can target specific elements

    • Add an external stylesheet using:

<link rel="stylesheet" href="styles.css">
  • To see how CSS works with this HTML example, read the CSS Implementation Notes, which show exactly how these elements are styled across pages

Example

  • This example matches the CSS file used in the CSS revision notes

  • Every class and ID in this HTML has a corresponding CSS selector in styles.css

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>StudyHub - Home</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>

  <header id="mainHeader">
    <h1>StudyHub</h1>
    <p class="tagline">Your place for Computing Science revision</p>
    <nav>
      <a href="index.html" class="nav-link active">Home</a>
      <a href="notes.html" class="nav-link">Notes</a>
      <a href="contact.html" class="nav-link">Contact</a>
    </nav>
  </header>

  <main>
    <section class="feature">
      <h2>Exam practice</h2>
      <p>Try past paper style questions and check your answers.</p>
    </section>

    <section class="feature highlight">
      <h2>Flashcards</h2>
      <p>Quickly test yourself on key definitions.</p>
    </section>

    <section class="feature">
      <h2>Video tutorials</h2>
      <p>Short explanations for the trickiest topics.</p>
      <img src="images/revision.png" alt="Student revising at a desk" class="feature-image">
    </section>
  </main>

  <footer id="pageFooter">
    <p>&copy; 2025 StudyHub</p>
  </footer>

</body>
</html>

Breakdown of what is going on

  1. Page structure

<!DOCTYPE html>

  • Tells the browser the document uses HTML5

<html lang="en">

  • Root of the entire page

  • The language attribute improves accessibility

<head>

  • Contains information about the page, not displayed on it

    • <meta charset="UTF-8"> for correct character encoding

    • <title> shows in the browser tab

    • <link rel="stylesheet" href="styles.css"> links to the external CSS file

    • This is a relative file path, which keeps links working when files are moved together

<body>

  • Everything displayed in the browser window

  1. Header

  • <header id="mainHeader">

  • <header> groups the site title, tagline and navigation

  • id="mainHeader" matches #mainHeader { ... } in CSS

  • <h1> provides the main page heading

  • <p class="tagline"> uses a class the CSS specifically styles

  • Navigation links:

<a href="notes.html" class="nav-link">Notes</a>

  • href="notes.html" is a relative internal link

  • class="nav-link" matches .nav-link { ... } in CSS

  • .nav-link:hover applies styles when the mouse is over the link

  • .active highlights the current page

  1. Main content

  • <main> contains multiple content blocks structured with <section>

  • Shared class: .feature

<section class="feature">

  • Used for:

    • background colour

    • padding

    • spacing

    • heading styling

  • Additional class: .highlight

  • Adds a different background colour:

<section class="feature highlight">

  • Shows how multiple classes can be combined

  1. Heading and paragraphs

  • Each section includes:

<h2>...</h2>
<p>...</p>
  • <h1> for the page title

  • <h2> for section headings

  • <p> for text

  • Ability to style them via CSS

  1. Images

<img src="images/revision.png" alt="Student revising at a desk" class="feature-image">

  • Important points:

    • <img> uses a relative file path

    • alt text helps accessibility

    • class="feature-image" matches its CSS rules controlling size and layout

  1. Footer

<footer id="pageFooter">

  • Matches

#pageFooter { ... }

  • Used for consistent page-ending structure and styling

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Robert Hampton

Author: Robert Hampton

Expertise: Computer Science Content Creator

Rob has over 16 years' experience teaching Computer Science and ICT at KS3 & GCSE levels. Rob has demonstrated strong leadership as Head of Department since 2012 and previously supported teacher development as a Specialist Leader of Education, empowering departments to excel in Computer Science. Beyond his tech expertise, Robert embraces the virtual world as an avid gamer, conquering digital battlefields when he's not coding.

James Woodhouse

Reviewer: James Woodhouse

Expertise: Computer Science & English Subject Lead

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.