Internal and External CSS
Describe, read and implement internal and external CSS using selectors, classes, IDs and required text and background properties.
How to study National 5 Computing Science
Move from functional requirements to designs and implementation, trace data and code carefully, and support testing and evaluation with evidence.
Core concepts
Concept 1
Internal CSS is placed within one HTML document; external CSS is stored in a linked stylesheet and can serve multiple pages.
Exam cue: Match the selector form to the class, ID or HTML element being styled.
Concept 2
Selectors target elements, classes target reusable groups and IDs target uniquely identified elements.
Exam cue: Trace cascade and scope only as far as needed to identify the applied required property.
Concept 3
Required properties cover font family, font size, text colour, alignment and background colour.
Risk pitfalls and guardrails
Using a class selector for an ID or omitting the correct prefix.
Guardrail: Check option route, data type, valid boundary, loop condition, array index, identifier and expected output before committing to the response.
Claiming an external stylesheet must be copied into every HTML page.
Guardrail: Check option route, data type, valid boundary, loop condition, array index, identifier and expected output before committing to the response.
Memory anchors
Internal CSS
Style rules stored within the individual HTML document.
External CSS
Style rules stored in a separate file linked from one or more pages.
Element selector
Target every matching HTML element name.
Class selector
A dot-prefixed selector can style multiple elements sharing a class.
ID selector
A hash-prefixed selector targets the element with that ID.
Required properties
Font family, font size, colour, alignment and background colour.
Checkpoint rule
Do the check-up only after you can summarize each concept in one sentence and identify one dangerous pitfall from memory.
Knowledge Check (after reading)
Short check-up to confirm understanding of this module.
Check-up Questions
A navigation map has Home → Gallery and Gallery → Home. What does this ensure?
Why label links with meaningful destination text?
Answer all questions to submit.
Next step personalized recommendations
Continue learning
Move forward only after this module is stable.
What is Pass Harbor?
Completely free exam prep for 247 UK exams.
- Practice questions
- Flashcards
- Study guides
- Mock exams
- No registration
- No paywall
- Start instantly
“No more expensive exam prep. Quality study tools should be accessible to everyone.”
