CSS HEX Colors — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS HEX Colors 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
Use a six-digit hex
easy10 minSet the #box text colour to #ff5733.
- 2
Use a three-digit hex
easy10 minGive #box a #0f0 background.
- 3
Mix the channels
easy10 minSet the #box text colour to #000080.
- 4
Shorthand with three channels
easy10 minGive #box a #fc0 background.
- 5
Use two hex colours
medium10 min#ffffff text on a #333333 background.
Find the bug(5)
- 1
Fix the missing hash
easy8 minA hex colour starts with #.
- 2
Fix the five-digit hex
easy8 minHex colours have three, six or eight digits.
- 3
Fix the out-of-range digit
easy8 minHex digits only run 0-9 and a-f.
- 4
Fix the wrong shorthand
easy8 minThe background should be #fc0, not #f00.
- 5
Fix the swapped colours
easy8 minThe light colour belongs on the text.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace