By the end of this section students will be able to create hyperlinks (from text or images) that:
| Layer | Purpose | Typical Technologies (relevant to this syllabus) |
|---|---|---|
| Content | Structure and meaning of the page | HTML – e.g. <a>, <div>, <table>, <img> |
| Presentation | How the page looks | CSS – external stylesheet, internal <style>, or inline styles |
| Behaviour | Interaction and dynamic effects | JavaScript, HTML5 APIs (optional – not required for the 0417 exam) |
Hyperlinks are created in the content layer using the <a> element. Their colour, underline and hover effects are controlled in the presentation layer with CSS. Any extra behaviour (e.g., a confirmation dialog) would belong to the behaviour layer, but this is not required for the IGCSE exam.
When constructing a web page for the Cambridge 0417 exam, the <head> section must contain exactly the following meta‑tags (unless the exam question states otherwise):
<meta charset="UTF-8"> – character encoding (mandatory)<meta name="viewport" content="width=device-width, initial-scale=1.0"> – makes the page responsive (mandatory)<meta name="description" content="Brief description of the page"> – used by search engines (mandatory)<meta name="keywords" content="keyword1, keyword2"> – optional but often required in exam tasks<meta name="author" content="Your Name"> – optional but useful for credit<title>Your Page Title</title><link rel="stylesheet" href="styles.css"> – attaches an external CSS file (relative path only)<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Sample page for IGCSE ICT">
<meta name="keywords" content="hyperlink, bookmark, CSS">
<meta name="author" content="Your Name">
<title>Hyperlink Demo</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Page content goes here – see sections below -->
</body>
</html>
<div> and Classes for OrganisationGrouping related elements with <div> makes the markup easier to read and lets CSS target whole sections.
<div class="nav">
<a href="index.html">Home</a>
<a href="about.html">About</a>
<a href="contact.html">Contact</a>
</div>
Why use classes instead of inline styles?
<style> → inline style="…" (the order required for quick recall).styles.css, images/pic.jpg). Absolute paths such as C:\myfiles\... are marked wrong..myClass) can be applied to many elements; an ID (#myId) must be unique and has higher specificity./* Basic page layout */
body {
font-family: Arial, Helvetica, sans-serif;
line-height: 1.5;
margin: 0;
padding: 0;
}
/* Navigation bar */
.nav a {
color: #0066cc;
text-decoration: none;
margin-right: 1rem;
}
.nav a:hover {
text-decoration: underline;
}
/* Link types – colour coding for exam marking */
a.external { font-weight: bold; color: #d9534f; } /* external URLs */
a.bookmark { color: #5cb85c; } /* intra‑page links */
/* Table styling */
table {
border-collapse: collapse;
width: 100%;
margin: 1rem 0;
}
th, td {
border: 1px solid #ccc;
padding: 0.5rem;
}
th {
background-color: #f2f2f2;
}
<link rel="stylesheet" href="styles.css">
id (or the older name attribute).#) followed by the id.<h2 id="chapter3">Chapter 3 – Advanced Topics</h2>
...
<a href="#chapter3" class="bookmark">Jump to Chapter 3</a>
Use a relative path. The path is written from the location of the current file.
<a href="about.html">About Our School</a>
pages:<a href="pages/contact.html">Contact Page</a>
<a href="../index.html">Home</a>
Always include the protocol (http:// or https://). For exam answers, indicate the target behaviour (new tab) if required.
<a href="https://www.bbc.com" target="_blank" class="external">BBC News</a>
The mailto: scheme opens the user’s default e‑mail client with a pre‑filled address, subject and (optionally) body.
<a href="mailto:info@example.com?subject=Inquiry&body=Hello%20team"%gt;Email Us</a>
Remember to URL‑encode spaces (%20) and other special characters in the query string.
target Attribute)target="_self" or omit the attribute.target="_blank".helpWindow); subsequent links with the same name reuse that window.<a href="page2.html" target="_self">Same window</a>
<a href="https://en.wikipedia.org" target="_blank">New tab</a>
<a href="help.html" target="helpWindow">Help (named window)</a>
<a href="faq.html" target="helpWindow">FAQ – same named window</a>
Wrap the <img> element inside an <a> tag. The image must always have meaningful alt text – this is a mandatory requirement for the exam.
<a href="gallery.html" target="_blank">
<img src="images/thumb.jpg" alt="Open gallery" width="150">
</a>
HTML5 provides <audio> and <video> elements with built‑in controls. Always supply fallback text for browsers that do not support the element.
<audio controls>
<source src="media/song.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<video width="320" height="240" controls>
<source src="media/intro.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
The table below demonstrates <th>, <td>, colspan and rowspan. The CSS from styles.css will style it automatically.
<table>
<tr>
<th rowspan="2">Day</th>
<th colspan="2">Morning Session</th>
<th colspan="2">Afternoon Session</th>
</tr>
<tr>
<th>Subject</th>
<th>Room</th>
<th>Subject</th>
<th>Room</th>
</tr>
<tr>
<td>Monday</td>
<td>Maths</td>
<td>101</td>
<td>History</td>
<td>202</td>
</tr>
<!-- Additional rows omitted for brevity -->
</table>
| Link Purpose | Example href | Target Attribute |
|---|---|---|
| Bookmark on same page | #section2 | _self (default) |
| Local page in same folder | contact.html | _self |
| External website | https://www.google.com | _blank |
| E‑mail address | mailto:support@example.com?subject=Help | _self |
| Named window (e.g., help) | help.html | helpWindow |
top at the very beginning of the page.resources.html in a new tab.admin@school.org with the subject “Website feedback”.https://www.example.com, not www.example.com).my-page.html) or underscores.# when linking to a bookmark.target="_blank" without informing the user – add a visual cue (e.g., an icon) or text such as “(opens new tab)”.C:\site\page.html) – the exam requires relative paths only.alt text for every <img> – mandatory for accessibility and AO2.<a href="page.html">Link text</a>
<a href="page.html" target="_blank">Link</a>
<a href="page.html" target="myWin">Link</a>
<a href="#section">Jump to section</a>
<a href="mailto:name@domain.com">Email</a>
<a href="https://example.com">External site</a>
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.