Pseudo-classes
A keyword added after a selector with a colon that targets an element based on its state or position, e.g. :hover or :focus.
What it does: :last-child selects the final child element within its parent container. Pseudo-classes use a colon (:). A dot (.) selects a class attribute, not a state. :hover responds to mouse position. :focus responds to keyboard or click focus. :first-child targets only the first child of a parent, not all matching elements. :visited applies to links in the browser's history. :active applies during a click. a:hover is a pseudo-class selector that activates on mouse-over. input:focus applies whenever the input element is focused by the user.
Common mistakes: Pseudo-classes use a colon, not a dot. a.hover tries to match an element with class='hover'. The correct selector is a:hover. CSS declarations need a colon between the property and value. It should be border: 2px solid blue; not border 2px solid blue;.
Free printable worksheet with full answer key — or add this module to a journey and assign it to your class.
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
pseudo-classFill in the Blanks
Spot the Error
Create a free class, add this module to a journey, and track who's stuck.
Create a free teacher account →No credit card. No setup fee. Make a class and invite students in under three minutes.
Practice this topic interactively, track progress, and unlock badges.
Start Learning Free →