Backgrounds
Shorthand property to set all background style properties like color, image, position, and repeat in a single declaration.
What it does: The rgba function sets Red, Green, Blue, and an Alpha transparency layer between 0 and 1. background-position: center automatically aligns the graphic vertically and horizontally. The background shorthand combines color, image, position, size, and repeat into a single line. CSS uses the url() function to point to image sources for backgrounds. cover fills the element completely, cropping if needed, while contain ensures the whole image is visible without cropping. Background colors are layered behind background images, serving as a fallback if the image fails to load. Setting background-repeat to no-repeat stops the default horizontal and vertical tiling behavior. The contain value guarantees that no parts of the background image are cut off or hidden.
Common mistakes: Line 1 is incorrect because background-image values must be wrapped inside a url() function, not as a raw string. Line 2 is incorrect because repeat-yes is invalid. Use repeat, no-repeat, repeat-x, or repeat-y.
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
backgroundFill 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 →