Anatomy of a CSS rule: selector, property and value
A CSS rule: a selector (p) picks elements, then { } hold declarations. Each declaration is property, colon, value, semicolon, so all paragraphs get blue text.
Understanding Anatomy of a CSS rule: selector, property and value in ACARA Digital Technologies Years 9–10
What it does: The p selector has one pair of braces holding two property: value; declarations, so both styles apply to every paragraph. background-color is the property, the colon separates it from the value yellow, and the semicolon ends the declaration. The property is the name of the setting (font-size). The value, 20px, is what that setting is changed to. CSS comments use /* and */. The <!-- --> style is for HTML comments and does not work in CSS. Every declaration should end with a semicolon. The last one can sometimes work without it, but adding it avoids bugs when you add more declarations.
Common mistakes: A declaration needs a colon between the property and the value, not an equals sign. It should be text-align: center;. The colon between the property and the value is missing. It should be color: red;.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 155–225) and word search (Modules 116–225).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
p { color: blue; }Fill in the Blanks
Spot the Error
Student with a class code? Join your class →