Students will be able to create, comment, and attach an external stylesheet to an HTML document, understand the three web‑development layers, and see how this fits into the Cambridge IGCSE (0417) syllabus.
| Syllabus Area | Key Idea for Web Authoring |
|---|---|
| 1.1 – Computer hardware & software | Operating system & browser render HTML/CSS. |
| 1.2 – Input & output devices | Keyboard for coding; monitor for visual feedback. |
| 1.3 – Storage | Files saved as .html and .css in a logical folder hierarchy. |
| 1.4 – Networks & the Internet | Pages transferred via HTTP; use relative URLs so the site works on any server. |
| 1.5 – E‑safety & legal issues | Respect copyright, use licences, and add alt text for accessibility. |
| 1.6 – Systems life‑cycle | Plan → design → develop → test → maintain a web page. |
| 1.7 – Data representation | HTML = text‑based markup; CSS = property/value pairs. |
| 1.8 – Algorithms & problem solving | Break a page into sections (header, nav, main, footer) and reuse CSS classes. |
| 1.9 – Spreadsheets & databases (context) | HTML tables display tabular data; CSS controls appearance. |
| 1.10 – Presentations (context) | Web pages are digital presentations; layout techniques mirror slide design. |
The behaviour layer adds interactivity with client‑side scripting (e.g., JavaScript). In the IGCSE exam only HTML (content) and CSS (presentation) are required, but limited interactivity can still be achieved using CSS alone, for example the :hover pseudo‑class:
/* Change link colour when the mouse is over it */a:hover { colour: #ff6600; }
index.html – main pagecss/ – external stylesheets (e.g., styles.css)images/ – graphics, icons, photosmedia/ – audio & video files<link rel="stylesheet" href="css/styles.css"> inside the <head> (relative path).<!DOCTYPE html> <!-- HTML5 doctype – required by the syllabus --><html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Web Page</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
…content goes here…
</body>
</html>
| Meta‑tag | Purpose |
|---|---|
<meta charset="UTF-8"> | Defines character encoding. |
<meta name="viewport" content="width=device-width, initial-scale=1"> | Enables responsive design on mobile devices. |
<meta name="description" content="Brief page summary"> | SEO – used by search engines. |
<meta name="keywords" content="HTML, CSS, IGCSE"> | Optional SEO keywords. |
<meta name="author" content="Your Name"> | Identifies the creator. |
<h1>…</h1> to <h6><p>…</p><ol>, <ul>, <dl><table> only for tabular data. Add <caption>, <thead>, <tbody> for accessibility.<img src="images/pic.jpg" alt="Descriptive text"> – alt is mandatory for e‑safety & accessibility.<audio controls>…</audio>, <video controls>…</video><a href="page.html">Link text</a><a id="section1"> + <a href="#section1">label elements linked via for attribute for each form control.<header>, <nav>, <main>, <section>, <article>, <footer>site with sub‑folders css and images.index.html.alt), and a navigation list.Place the following line inside the <head> of every page that should share the same design:
<link rel="stylesheet" href="css/styles.css">Remember: use a relative path (no leading / or drive letters) so the site works when moved to a different server.
| Selector Type | Example | What it selects |
|---|---|---|
| Element | p { … } | All <p> elements. |
| Class | .highlight { … } | Any element with class="highlight". |
| ID | #mainNav { … } | Element with id="mainNav" (unique). |
| Descendant | nav ul li { … } | <li> inside a <ul> inside a <nav>. |
| Attribute | a[href$=".pdf"] { … } | All links ending with “.pdf”. |
| Pseudo‑class | a:hover { … } | When the mouse pointer is over a link. |
| Property | Purpose | Typical Value |
|---|---|---|
margin | Space outside the element. | margin: 0 1rem; |
padding | Space inside the element. | padding: 10px 20px; |
border | Outline of the element. | border: 2px solid #333; |
background | Background colour or image. | background: #f0f0f0; |
font-family | Typeface for text. | font-family: Arial, sans-serif; |
font-size | Size of text. | font-size: 1.2rem; |
colour | Text colour. | colour: #333; |
text-align | Horizontal alignment of text. | text-align: centre; |
display | Layout behaviour (block, inline, flex, grid). | display: flex; |
position | Static, relative, absolute, fixed, sticky. | position: relative; |
| Unit | Type | Typical Use |
|---|---|---|
px | Absolute | Precise borders, images. |
em | Relative to the font‑size of the parent element. | Scalable typography. |
rem | Relative to the root (html) font‑size. | Consistent spacing across the page. |
% | Relative to the parent element’s dimensions. | Widths, heights, margins. |
0‑0‑10‑1‑01‑0‑0style attribute – 1‑0‑0‑0 (highest author level)/* Tablet and larger screens */@media (min-width: 768px) {
.grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
}
}
/* Mobile phones */
@media (max-width: 767px) {
.grid {
display: block;
}
}
Note: The IGCSE exam does not require responsive design, but understanding media queries helps students write modern, future‑proof code.
/* Main navigation styles *//*Header layout
Adjust for mobile view
*/
Important: CSS comments cannot be nested. Trying to place a comment inside another will cause a syntax error.
In the IGCSE practical, comments are not counted towards the 70‑mark total, but they are required in the “evidence” documentation to demonstrate planning and reasoning (AO3).
/* -------------------------------------------------1. Reset – removes default browser spacing
------------------------------------------------- */
{ margin: 0;
padding: 0;
box-sizing: border-box;
}
/* -------------------------------------------------
2. Global page settings
------------------------------------------------- */
body {
line-height: 1.6;
colour: #333;
background: #fafafa;
}
/* -------------------------------------------------
3. Header
------------------------------------------------- */
header {
background: #003366;
colour: #fff;
text-align: centre;
padding: 1rem;
}
/* -------------------------------------------------
4. Navigation – comment out to test layout
------------------------------------------------- */
/* nav {
background: #005599;
padding: 10px;
} */
<link> Element (HTML)<!-- Link to external stylesheet --><link rel="stylesheet" href="css/styles.css">
<!-- To disable temporarily, wrap the line in an HTML comment:
<!-- <link rel="stylesheet" href="css/styles.css"> -->
-->
css/styles.css)/* styles.css – External stylesheet *//* -------------------------------------------------
1. Reset – removes default browser spacing
------------------------------------------------- */
{ margin: 0;
padding: 0;
box-sizing: border-box;
}
/* -------------------------------------------------
2. Global page settings
------------------------------------------------- */
body {
line-height: 1.6;
colour: #333;
background: #fafafa;
}
/* -------------------------------------------------
3. Header
------------------------------------------------- */
header {
background: #003366;
colour: #fff;
text-align: centre;
padding: 1rem;
}
/* -------------------------------------------------
4. Navigation – simple hover effect (behaviour layer)
------------------------------------------------- */
nav a:hover {
colour: #ff6600;
}
/* -------------------------------------------------
5. Main content area
------------------------------------------------- */
main {
padding: 2rem;
}
/* -------------------------------------------------
6. Footer
------------------------------------------------- */
footer {
background: #222;
colour: #ddd;
text-align: centre;
padding: 1rem;
}
index.html)<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First IGCSE Web Page</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<header>
<h1>Welcome to My Site</h1>
</header>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
<main>
<h2>About This Page</h2>
<p>This page demonstrates how to <strong>link</strong> an external stylesheet and use CSS comments.</p>
<img src="images/sample.jpg" alt="Sample illustration">
</main>
<footer>
<p>© 2026 Your Name</p>
</footer>
</body>
</html>
<!DOCTYPE html>.header, nav, main, footer).alt text.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.