By the end of this lesson you will be able to:
id attribute.id attributes, etc.).| Element | Example | Why it is required |
|---|---|---|
<meta charset="UTF-8"> | Specifies character encoding. | Ensures all characters (including non‑ASCII) display correctly on any device. |
<meta name="description" content="…"> | Provides a brief description for search engines. | Improves discoverability and demonstrates understanding of meta‑data (AO1). |
<meta name="keywords" content="HTML, bookmark, internal link"> | Lists relevant keywords. | Helps search engines index the page; part of the required meta‑tags. |
<meta name="viewport" content="width=device-width, initial-scale=1"> | Makes the page responsive on mobile devices. | Ensures the layout scales correctly – a compulsory tag for modern web pages. |
<title>…</title> | Page title shown in the browser tab. | Identifies the page to the user and to search engines. |
<link rel="stylesheet" href="styles.css"> | Links an external CSS file (relative path). | Separates presentation from content and satisfies the relative‑path requirement. |
<h1> – <h6> (use the appropriate level for document structure).<section>, <article> – help define logical parts of the page.<ol>) and unordered (<ul>) for a table of contents.<table>, <tr>, <th>, <td>.<img src="images/pic.jpg" alt="…" width="300"> – use relative paths.<video> with <source> (also relative).<div> for grouping media or styling.<a href="#targetID">Link text</a> – the core of a bookmark.target="self" (default) or target="blank" for a new tab.id attribute: unique identifier for the element that will receive the bookmark focus.The stylesheet must be linked with a relative path and can contain both visual and layout properties.
/* styles.css – example */.toc-link {
color: #0066cc; /* visual – colour the TOC links blue */
text-decoration: none;
font-weight: bold;
margin-bottom: 0.5em; /* layout – adds space between links */
}
.toc-link:hover {
text-decoration: underline;
}
/* Simple layout for headings and media */
h3 {
margin-top: 2em;
color: #333;
}
.media {
margin-top: 1.5em;
}
.media img,
.media video {
display: block;
max-width: 100%;
height: auto;
}
For the IGCSE exam only HTML and CSS are assessed. Any JavaScript would be ignored and could cause a loss of marks.
<div>).id value (e.g., id="section1").<a class="toc-link" href="#section1">Go to Section 1</a>target="_blank" if the link should open a new tab..toc-link) in the external CSS file.The example below follows the syllabus requirements: required meta‑tags, relative paths, semantic headings, a table of contents, a table, an image, a video, and a bookmark link that opens in a new tab.
<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="Bookmark example for IGCSE ICT">
<meta name="keywords" content="HTML, bookmark, internal link, CSS">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bookmark Example</title>
<link rel="stylesheet" href="styles.css"> <!-- relative path – required -->
</head>
<body>
<h1>My Sample Page</h1>
<h2>Table of Contents</h2>
<ul>
<li><a class="toc-link" href="#section1">Section 1 – Introduction</a></li>
<li><a class="toc-link" href="#section2">Section 2 – Data Table</a></li>
<li><a class="toc-link" href="#section3">Section 3 – Media</a></li>
<li><a class="toc-link" href="#section4" target="_blank">Section 4 – Summary (new tab)</a></li>
</ul>
<section id="section1">
<h3>Section 1 – Introduction</h3>
<p>...content for section 1...</p>
</section>
<section id="section2">
<h3>Section 2 – Data Table</h3>
<table border="1">
<tr><th>Item</th><th>Description</th></tr>
<tr><td>Apple</td><td>A sweet fruit.</td></tr>
<tr><td>Banana</td><td>A yellow fruit.</td></tr>
</table>
</section>
<section id="section3">
<h3>Section 3 – Media</h3>
<div class="media">
<img src="images/sample.jpg" alt="Sample image" width="300">
<!-- relative path to the images folder – required -->
<video width="320" controls>
<source src="video/sample.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
</section>
<section id="section4">
<h3>Section 4 – Summary</h3>
<p>...content for section 4...</p>
</section>
</body>
</html>
| Issue | Consequence | How to Fix |
|---|---|---|
Missing id on target element | Link does nothing or jumps to the top of the page | Add a unique id to the element you want to jump to. |
Duplicate id values | Browser jumps to the first matching element only | Ensure every id is unique within the page. |
Spaces or illegal characters in id | Invalid identifier; link fails | Use only letters, numbers, hyphens (-), underscores (_) and periods (.). |
| Absolute file paths for CSS, images or video | Page may break when moved to another computer | Always use relative paths (e.g., styles.css, images/pic.png, video/clip.mp4). |
Styling a bookmark link with an id instead of a class | Violates the “class vs. id” rule and makes future changes harder | Use a class (e.g., .toc-link) for styling; reserve id for the target element only. |
Use a class for any visual styling that will be applied to multiple elements (e.g., all TOC links). Keep id values for the single element that receives the bookmark focus. This follows the syllabus rule that id is unique, whereas a class can be reused.
images to pics.src attribute of the image in the example page to pics/sample.jpg.bookmark_test.html.<head> section, add the six meta‑tags from the checklist and link to an external stylesheet styles.css (you may leave the CSS file empty for now).<h2>My Favourite Recipes</h2>.<a href="#recipe1">Spaghetti Bolognese</a>id (recipe1, recipe2, recipe3) and a paragraph of placeholder text.images/spaghetti.jpg).styles.css add a rule to colour the TOC links blue and give them a bottom margin of 0.4em.id attribute, and write the syntax of an internal link (<a href="#id">).id values.div, class, target attribute) is present.
<a href="#section"> → browser reads the hash → scrolls to the element with id="section".
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.