HTML Basics II (SQA National 5 Computing Science): Revision Note

Exam code: X816 75

Robert Hampton

Written by: Robert Hampton

Reviewed by: James Woodhouse

Updated on

HTML basics II

  • HTML basics part 1 covers:

    • What is HMTL

    • Basic structure of a web page

    • Headings and paragraphs

    • Divisions tag

    • Image tag

    • Hyperlinks

    • Relative and absolute file paths

  • HTML basics part 2 covers:

    • Lists in HTML

    • Audio

    • Video

    • Full example

Lists in HTML

  • Lists are used to show information in a clear, structured way

Unordered list <ul>

  • Bullet point list

  • Each item is in an <li> element

<ul>
    <li>Starter</li>
    <li>Main course</li>
    <li>Dessert</li>
</ul>

Ordered list <ol>

  • Numbered list

  • Each item is in an <li> element

<ol>
    <li>Register for the event</li>
    <li>Check your email</li>
    <li>Attend the workshop</li>
</ol>

Audio with <audio>

  • You can embed sound files such as music or sound effects.

  • Basic example:

<audio controls>
    <source src="theme.mp3" type="audio/mpeg">
</audio>
  • Key points:

    • controls shows the play and pause buttons

    • <source> gives the file and its type

Video with <video>

  • You can embed video clips

  • Basic example:

<video controls width="400">
    <source src="trailer.mp4" type="video/mp4">
</video>
  • Key points:

    • controls shows play, pause etc

    • width can be used to set the size

Example

<html>
<head>
    <title>School Sports Day</title>
</head>
<body>
    <h1>School Sports Day</h1>
    <p>The School Sports Day will be held on Friday.</p>

    <h2>Events</h2>
    <ul>
        <li>100m sprint</li>
        <li>Long jump</li>
        <li>Relay race</li>
    </ul>

    <h2>Location</h2>
    <p>The event will take place on the school field.</p>
    <img src="field.jpg" alt="School sports field">

    <h2>More information</h2>
    <a href="rules.html">View full rules</a><br>
    <a href="https://www.metoffice.gov.uk">Check the weather</a>

    <h2>Highlights from last year</h2>
    <video controls width="320">
        <source src="sportsday2024.mp4" type="video/mp4">
    </video>
</body>
</html>
  • This example covers:

    • <html>, <head>, <title>, <body>

    • Headings and paragraphs

    • <ul> and <li>

    • <img>

    • Internal and external hyperlinks

    • <video>

Worked Example

A student is building the homepage.html file for a new website.

Write the minimum HTML markup required to implement the following two pieces of content within the <body> of the page:

  1. A top-level heading displaying the text: "Welcome to our Wildlife Sanctuary"

  2. An image file named map.jpg, located in a sub-folder called media/ relative to the current file

[2]

Answer

<h1>Welcome to our Wildlife Sanctuary</h1>

  • Correctly implementing a heading element (e.g., <h1>) containing the required text content [1 mark]

<img src="media/map.jpg" />

  • Correctly implementing the image tag (<img src="...">) using the required file name and the correct relative path (media/map.jpg) [1 mark]

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.