CSS Background Image — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS Background Image lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Exercises(5)
- 1
Add a gradient
easy10 minGive #box a linear gradient from red to blue.
- 2
Set the gradient direction
easy10 minMake the red-to-blue gradient run left to right.
- 3
Use a radial gradient
easy10 minGive #box a circular red-to-blue gradient.
- 4
Stop the tiling
easy10 minAdd a gradient and stop the background repeating.
- 5
Cover and centre
medium10 minA no-repeat gradient, sized to cover and centred.
Find the bug(5)
- 1
Fix the missing comma
easy8 minGradient colour stops are comma separated.
- 2
Fix the direction keyword
easy8 minA gradient direction is written as "to right".
- 3
Fix linear used where radial was meant
easy8 minThis gradient should radiate from the centre.
- 4
Fix the repeat value
easy8 minThe value is no-repeat.
- 5
Fix the size keyword
easy8 minThe value is cover, not covers.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace