By the end of this unit you will be able to:
| Layer | Purpose | Key HTML / CSS Features |
|---|---|---|
| Content (HTML) | Structure and meaning of the page. | Doctype, <html>, <head>, <body>, headings, paragraphs, lists, images, audio, video, <embed>/<iframe>, tables, forms, links, class/id attributes, accessibility attributes. |
| Presentation (CSS) | Visual appearance – fonts, colours, spacing, layout. | Selectors, cascade, specificity, external vs. embedded vs. inline styles, font-family, font-size, color, text-align, font-weight, font-style, background, margin, padding, border, display/float, responsive units. |
| Behaviour (Security & e‑Safety) | Protect data and users when the page interacts with the web. | Secure form handling, mailto: vs. server‑side scripts, HTTPS/SSL, safe linking, alt text for images, proper use of label elements, basic client‑side validation attributes (required, pattern, type), and a note that JavaScript is **not required** for the IGCSE exam. |
<!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 Page</title>
<link rel="stylesheet" href="css/style.css"> <!-- external CSS -->
</head>
<body>
...content...
</body>
</html>
<h1>–<h6> – headings (semantic hierarchy).<p> – paragraph.<ul>, <ol>, <li> – unordered / ordered lists.<img src="…" alt="…"> – image with alternative text.<a href="…" target="_blank"> – hyperlink (internal or external).<div> and <span> – generic containers; useful for applying classes/IDs.class="…" and id="…" – hooks for CSS and JavaScript.<audio src="song.mp3" controls>Your browser does not support audio.</audio><video src="movie.mp4" width="320" height="240" controls>Your browser does not support video.</video><embed src="flash.swf" width="300" height="200"> – generic embedded object.<iframe src="https://www.youtube.com/embed/xyz" width="560" height="315"></iframe> – external content.| Header 1 | Header 2 | Header 3 |
|---|---|---|
| Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 |
| Spanning two columns | Row 2 Col 3 | |
Accessibility tip: always use <caption> and scope="col"/scope="row" where appropriate.
A form for the exam should demonstrate a range of input types and client‑side validation attributes. The form itself must be processed on a secure server (HTTPS) – never rely on mailto: for personal data.
<form action="process.php" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required><br>
<label for="dob">Date of Birth:</label>
<input type="date" id="dob" name="dob"><br>
<label for="phone">Phone:</label>
<input type="tel" id="phone" name="phone" pattern="[0-9]{10}"
title="Enter a 10‑digit phone number"><br>
<label for="gender">Gender:</label>
<input type="radio" id="male" name="gender" value="M">
<label for="male">Male</label>
<input type="radio" id="female" name="gender" value="F">
<label for="female">Female</label><br>
<label for="newsletter">
<input type="checkbox" id="newsletter" name="newsletter">
Subscribe to newsletter
</label><br>
<label for="feedback">Feedback:</label>
<textarea id="feedback" name="feedback" rows="4" cols="30"></textarea><br>
<button type="submit">Send</button>
</form>
e‑Safety note: Use HTTPS, validate inputs on the server side, and never expose personal data in the URL.
p { … }.highlight { … }#mainTitle { … }ul li { … }The cascade decides which rule wins when several apply. Specificity hierarchy (low → high): element → class → ID → inline style → !important.
<link rel="stylesheet" href="css/style.css"><link rel="stylesheet" href="https://example.com/style.css"><style> in the <head> (useful for short projects).style="…" attribute on an element (only for demonstration; not exam‑recommended).color – text colour.background-color / background-image.margin, padding, border – box‑model spacing.display (block, inline, inline‑block) and float – basic layout.em, rem, %, vh/vw.Arial, "Helvetica Neue", sans-serif).12px, 1.2em, 80%).left, right, center, justify.normal, bold, numeric values (100‑900).normal, italic, oblique.<p style="font-family: Arial; font-size: 14px; color:#333333;
text-align: justify; font-weight:bold; font-style:italic;">
This paragraph demonstrates all six font properties.
</p>
| Generic family | Typical fonts | Typical use |
|---|---|---|
| serif | Times New Roman, Georgia | Print‑like documents, formal reports |
| sans‑serif | Arial, Verdana, Helvetica | Web pages, headings, modern layouts |
| monospace | Courier New, Consolas | Code snippets, tabular data |
| cursive | Comic Sans MS, Brush Script | Informal notes, decorative text |
| fantasy | Impact, Papyrus | Special effects, titles |
1 em).1.5 em, 2 em, etc.).Ensure a contrast ratio of at least 4.5 : 1 for normal text. Tools such as the WebAIM Contrast Checker can be used.
left – default for LTR languages.right – RTL languages or special effects.center – headings, titles, short blocks.justify – newspaper‑style articles.<strong> – strong importance (rendered bold).<b> – visual bold only.<em> – emphasis (rendered italic).<i> – visual italic only.This example meets the exam requirement of using an external stylesheet, reusable classes, and a clear folder structure.
Folder structure
│
├─ index.html
└─ css/
└─ style.css
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IGCSE Font Demo</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1 id="mainTitle">Website Authoring – Font Properties</h1>
<p class="intro">
This paragraph demonstrates the six core font properties using a reusable CSS class.
</p>
<h2>Multimedia Example</h2>
<audio src="media/sample.mp3" controls>Your browser does not support audio.</audio>
<video src="media/sample.mp4" width="320" height="240" controls>Your browser does not support video.</video>
<h2>Sample Table</h2>
<table class="data">
<thead>
<tr><th scope="col">Item</th><th scope="col">Quantity</th></tr>
</thead>
<tbody>
<tr><td>Apples</td><td>12</td></tr>
<tr><td colspan="2">Total — 12</td></tr>
</tbody>
</table>
<h2>Contact Form</h2>
<form action="process.php" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required><br>
<label for="dob">Date of Birth:</label>
<input type="date" id="dob" name="dob"><br>
<label for="phone">Phone:</label>
<input type="tel" id="phone" name="phone"
pattern="[0-9]{10}" title="Enter a 10‑digit phone number"><br>
<label for="gender">Gender:</label>
<input type="radio" id="male" name="gender" value="M">
<label for="male">Male</label>
<input type="radio" id="female" name="gender" value="F">
<label for="female">Female</label><br>
<label for="newsletter">
<input type="checkbox" id="newsletter" name="newsletter">
Subscribe to newsletter
</label><br>
<label for="feedback">Feedback:</label>
<textarea id="feedback" name="feedback" rows="4" cols="30"></textarea><br>
<button type="submit">Submit</button>
</form>
</body>
</html>
/* 1. Reset basic margins/padding */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* 2. Body – default font settings */
body {
font-family: "Helvetica Neue", Arial, sans-serif;
font-size: 1rem; /* 16 px on most browsers */
line-height: 1.5;
color: #222222;
background-color: #f9f9f9;
padding: 20px;
}
/* 3. Headings – size & weight */
h1, h2 {
font-weight: bold;
margin-bottom: 0.5em;
}
h1 {
font-size: 2rem; /* 32 px */
text-align: center;
color: #003366;
}
h2 {
font-size: 1.5rem; /* 24 px */
color: #004080;
}
/* 4. Reusable class for introductory paragraph */
.intro {
font-family: Georgia, serif;
font-size: 1.125rem; /* 18 px */
color: #333333;
text-align: justify;
margin-bottom: 1.5em;
}
/* 5. Table styling */
table.data {
width: 100%;
border-collapse: collapse;
margin-top: 1em;
}
table.data th,
table.data td {
border: 1px solid #ccc;
padding: 0.5em;
text-align: left;
}
table.data th {
background-color: #e0e0e0;
}
/* 6. Form styling */
form {
margin-top: 1.5em;
}
label {
display: inline-block;
width: 100px;
font-weight: 600;
}
input, textarea, button {
font-family: inherit;
font-size: 1rem;
margin-bottom: 0.5em;
}
button {
background-color: #0066cc;
color: #fff;
border: none;
padding: 0.5em 1em;
cursor: pointer;
}
button:hover {
background-color: #004c99;
}
Create an account or Login to take a Quiz
Log in to suggest improvements to this note.
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.