CSS Background Color — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS Background Color 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
Set a background
easy10 minGive #box a #f0f0f0 background.
- 2
Use a translucent background
easy10 minGive #box a black background at 50% opacity.
- 3
Match the text colour
easy10 minMake the #box background follow its text colour, which is red.
- 4
Colour the wrapper
easy10 minGive #wrap a #fffbe6 background.
- 5
Build a readable panel
medium10 minDark #1a1a1a background with #fafafa text.
Find the bug(5)
- 1
Fix the shorthand that wiped the colour
easy8 minA later background shorthand resets background-color.
- 2
Fix the alpha in a hex colour
easy8 minUse rgba() to get a half-transparent black.
- 3
Fix the misspelled keyword
easy8 minThe keyword is currentColor.
- 4
Fix the colour on the wrong element
easy8 minThe wrapper should carry the cream background.
- 5
Fix the unreadable pairing
easy8 minDark text on a dark background cannot be read.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace