Revision Notes
Cambridge IGCSE ICT (0417): Use stylesheets – Revision Notes
Revision notes for 0417 subtopic 21.3: CSS syntax, generic styles, classes, inline styles, font, background and table properties, comments and hierarchy.
- Subject
- ICT
- Level
- IGCSE
- Topic
- Topic 21: Website authoring
- Author
- Marlbridge Academic Team
- Updated
- Reviewed by
- Harris Khan (what this means)
Aligned to Cambridge IGCSE ICT (0417), 2026-2028. Official specification .
Syllabus page (what it covers and how it is assessed): Cambridge IGCSE ICT.
Syllabus points this page covers
0417
- 21.3 Use stylesheets
Found an error? Report a correction.
Need help with this topic? Request a free trial class for IGCSE ICT (0417).
These notes condense Cambridge IGCSE ICT 0417 subtopic 21.3 Use stylesheets: creating the presentation layer in CSS. The 21.3 Use stylesheets study guide explains each property and works through a hierarchy example. Test yourself with the 21.3 practice questions. The Website authoring revision notes cover all of Topic 21.
Key terms
| Term | Meaning |
|---|---|
| Cascading stylesheet (CSS) | A set of rules that format elements of web pages, saved with the .css extension |
| Attached (external) stylesheet | A separate .css file linked from the head of each page |
| Inline style attribute | A style attribute written inside one HTML tag |
| Selector | The part of a rule that says which elements it applies to |
| Declaration | A property and value pair, such as color: navy; |
| Generic style | A rule whose selector is an element (h1, p, li), applying to all such elements |
| Class | A named rule (.name) applying only to elements with class="name" |
| Comment | Notes in a stylesheet between /* and */, ignored by the browser |
| Hierarchy (cascade) | The order of priority used when rules conflict |
Rule syntax checklist
selector { property: value; property: value; }
- Colon between property and value; semicolon after each declaration.
- Curly brackets around declarations.
- Font names with spaces in quotation marks; end with a generic family (serif, sans-serif).
- CSS uses color and center.
Properties the syllabus names
| Group | Properties |
|---|---|
| Background | background-color, background-image: url("...") |
| Font | font-family, font-size, color, text-align, font-weight: bold, font-style: italic |
| Table size | width, height (px or %) |
| Table colour | background-color on table, tr, th or td |
| Alignment | text-align (horizontal), vertical-align (vertical: top, middle, bottom) |
| Spacing | border-spacing (gap between cells) |
| Padding | padding (gap inside a cell, between content and border) |
| Borders | border-collapse: collapse; border: 2px solid #333333 (thickness, style, colour); border: none (invisible) |
From task wording to CSS
| Instruction (invented) | Rule |
|---|---|
| “All paragraphs 12 point Tahoma, or a sans-serif font if Tahoma is unavailable” | p { font-family: Tahoma, sans-serif; font-size: 12pt; } |
| “Level 1 headings centred and bold” | h1 { text-align: center; font-weight: bold; } |
| “Table data cells with a 3 pixel dark red border” | td { border: 3px solid #8B0000; } |
| “Leave 10 pixels between cell contents and the border” | td { padding: 10px; } |
| “List items in italic” | li { font-style: italic; } |
| “A class called note with a light grey background” | .note { background-color: #D3D3D3; } |
Read each instruction for the element (selector), the property and the value, then check spelling and punctuation.
Style vs class
| Style | Class | |
|---|---|---|
| Written | p { ... } |
.notice { ... } |
| Applied | Automatically to every p | Only where class="notice" is added |
| Reusable on other element types? | No | Yes |
| Priority | Lower | Higher than a generic style for the same property |
Attached vs inline
| Attached stylesheet | Inline style | |
|---|---|---|
| Where | Separate .css file, linked in the head | Inside one tag |
| Scope | Every page that links it | One element |
| Maintenance | Change once | Change each element |
| Priority | Lower | Highest |
Hierarchy
- Inline style (highest).
- Attached stylesheets: the later link wins over an earlier one for the same selector.
- Non-conflicting properties from every source combine.
Quick example (invented): first.css sets h1 { color: green; font-size: 30px; }, second.css (attached later) sets h1 { color: maroon; }, and the tag is <h1 style="text-align: right;">. Result: maroon, 30px, right aligned.
File paths
- Attach with a relative path:
<link rel="stylesheet" href="css/site.css">. - Why? An absolute path (such as C:...) refers to one computer’s folders; on the web server or another computer it cannot be found and the pages lose their formatting.
- Paths inside a stylesheet, such as a background image, are relative to the stylesheet’s folder.
Exam traps
colour:orcentre: ignored by the browser.- Missing semicolon: the next declaration fails.
.classused in HTML, or a class rule without the full stop.- Padding and spacing confused.
- Borders shown as double lines when
border-collapse: collapsewas required. - Stylesheets attached in the wrong order, so the general style overrides the specific one.
- An external stylesheet containing HTML tags.
Self-test
- State the file extension of an external stylesheet.
- Write a CSS comment saying Main styles.
- Write a rule making every h3 italic and dark green (#006400).
- What is the difference between padding and border-spacing?
- Which property makes adjacent cell borders into single lines?
- Write a declaration that makes a border invisible.
- Write a class called warning with a yellow background and bold text.
- How is the class warning applied to a paragraph in the HTML?
- An attached stylesheet sets
p { color: blue; }; the tag is<p style="color: grey;">. What colour is the paragraph? - a.css and then b.css are attached. Both set the font size of li. Which wins?
- Give one reason for using an attached stylesheet instead of inline styles.
- Why must a relative path be used to attach a stylesheet?
Answers
- .css
/* Main styles */h3 { font-style: italic; color: #006400; }- Padding is the space inside a cell between its content and border; border-spacing is the space between neighbouring cells.
border-collapse: collapse;border: none;(orborder-style: hidden;)..warning { background-color: yellow; font-weight: bold; }<p class="warning">...</p>- Grey, because an inline style overrides the attached stylesheet.
- b.css, because it is attached later.
- Any one: one file formats every page consistently; a change is made once; it keeps presentation separate from content.
- So the link still works when the site is moved or uploaded; an absolute path refers to a folder that will not exist on another computer.
Syllabus reference
Cambridge International, Cambridge IGCSE Information and Communication Technology (0417) syllabus for 2026, 2027 and 2028, Topic 21 Website authoring, 21.3 Use stylesheets.
Related resources
-
Study guides
Cambridge IGCSE ICT (0417): Web development layers
The content, presentation and behaviour layers of a web page for Cambridge IGCSE ICT 0417 subtopic 21.1: what each does and why they are kept apart.
ICT · Cambridge · IGCSE
Read guide -
Practice questions
Cambridge IGCSE ICT (0417): Web development layers – Practice Questions
Original questions with full answers on the content, presentation and behaviour layers for 0417 subtopic 21.1, including classifying features and code.
ICT · Cambridge · IGCSE
Try questions -
Revision notes
Cambridge IGCSE ICT (0417): Web development layers – Revision Notes
Revision notes for 0417 subtopic 21.1: the content, presentation and behaviour layers, their languages, classifying features and why layers are kept separate.
ICT · Cambridge · IGCSE
Revise topic
Get free revision emails (optional)
Occasional emails with practice questions, worked explanations and links to free resources for the qualification and subjects you choose. No spam, and you can unsubscribe from any email. The free tools on this site never need an email.