CSS RGB Colors — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS RGB 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 rgb()
easy10 minSet the #box text colour to rgb(255, 87, 51).
- 2
Use the space-separated form
easy10 minGive #box a background of rgb(0 128 128).
- 3
Add an alpha channel
easy10 minSet the #box text to half-transparent red.
- 4
Use slash alpha syntax
easy10 minGive #box a background of blue at 25% opacity.
- 5
Combine two rgb colours
medium10 minrgb(255, 255, 255) text on rgb(20, 20, 20).
Find the bug(5)
- 1
Fix the semicolon separators
easy8 minrgb() channels are separated by commas or spaces.
- 2
Fix the reversed channels
easy8 minThe order is red, green, blue.
- 3
Fix the alpha above one
easy8 minAn alpha of 2 clamps to fully opaque.
- 4
Fix the missing slash
easy8 minIn the space-separated form the alpha follows a slash.
- 5
Fix the missing function
easy8 minBare numbers are not a colour.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace