Set the #box text colour to rgb(255, 87, 51).
Acceptance criteria
- 1.Set the #box text colour to rgb(255, 87, 51).
CSS Tutorial · CSS Colors and Backgrounds
These 10 tasks go with the CSS RGB Colors chapter. 5 of them ask you to build something small from scratch; 5 give you code that is already broken and ask you to work out why. Set aside about 90 minutes for the whole set, though you can do them in any order.
Nothing here is marked by a person. When you press Submit, the editor checks your code against the points listed under each task and tells you straight away what passed and what didn't (you need a free account to submit). If you get stuck, there are hints, and a worked solution once you've had a go. The first 2 tasks are free; the rest are part of the practice plan.
If it's been a while since you read the chapter, here is how it starts: “Define sRGB colors with modern rgb() syntax, percentages, channel values, and optional alpha transparency.” Read the chapter.
1.Use rgb()exercise · easy · 10 min
Set the #box text colour to rgb(255, 87, 51).
Passes when: Set the #box text colour to rgb(255, 87, 51).
2.Use the space-separated formexercise · easy · 10 min · practice plan
Give #box a background of rgb(0 128 128).
Passes when: Give #box a background of rgb(0 128 128).
3.Add an alpha channelexercise · easy · 10 min · practice plan
Set the #box text to half-transparent red.
Passes when: Set the #box text to half-transparent red.
4.Use slash alpha syntaxexercise · easy · 10 min · practice plan
Give #box a background of blue at 25% opacity.
Passes when: Give #box a background of blue at 25% opacity.
5.Combine two rgb coloursexercise · medium · 10 min · practice plan
rgb(255, 255, 255) text on rgb(20, 20, 20).
Passes when: rgb(255, 255, 255) text on rgb(20, 20, 20).
6.Fix the semicolon separatorsbug fix · easy · 8 min
rgb() channels are separated by commas or spaces.
Passes when: rgb() channels are separated by commas or spaces.
7.Fix the reversed channelsbug fix · easy · 8 min · practice plan
The order is red, green, blue.
Passes when: The order is red, green, blue.
8.Fix the alpha above onebug fix · easy · 8 min · practice plan
An alpha of 2 clamps to fully opaque.
Passes when: An alpha of 2 clamps to fully opaque.
9.Fix the missing slashbug fix · easy · 8 min · practice plan
In the space-separated form the alpha follows a slash.
Passes when: In the space-separated form the alpha follows a slash.
10.Fix the missing functionbug fix · easy · 8 min · practice plan
Bare numbers are not a colour.
Passes when: Bare numbers are not a colour.
Between them these tasks cover rgb() and rgba(), Alpha channels and Modern space syntax.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.