Set the #box text colour to #ff5733.
Acceptance criteria
- 1.Set the #box text colour to #ff5733.
CSS Tutorial · CSS Colors and Backgrounds
These 10 tasks go with the CSS HEX 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: “Write hexadecimal colors using short, long, and alpha forms, and understand how each pair of digits represents an sRGB channel.” Read the chapter.
1.Use a six-digit hexexercise · easy · 10 min
Set the #box text colour to #ff5733.
Passes when: Set the #box text colour to #ff5733.
2.Use a three-digit hexexercise · easy · 10 min · practice plan
Give #box a #0f0 background.
Passes when: Give #box a #0f0 background.
3.Mix the channelsexercise · easy · 10 min · practice plan
Set the #box text colour to #000080.
Passes when: Set the #box text colour to #000080.
4.Shorthand with three channelsexercise · easy · 10 min · practice plan
Give #box a #fc0 background.
Passes when: Give #box a #fc0 background.
5.Use two hex coloursexercise · medium · 10 min · practice plan
#ffffff text on a #333333 background.
Passes when: #ffffff text on a #333333 background.
6.Fix the missing hashbug fix · easy · 8 min
A hex colour starts with #.
Passes when: A hex colour starts with #.
7.Fix the five-digit hexbug fix · easy · 8 min · practice plan
Hex colours have three, six or eight digits.
Passes when: Hex colours have three, six or eight digits.
8.Fix the out-of-range digitbug fix · easy · 8 min · practice plan
Hex digits only run 0-9 and a-f.
Passes when: Hex digits only run 0-9 and a-f.
9.Fix the wrong shorthandbug fix · easy · 8 min · practice plan
The background should be #fc0, not #f00.
Passes when: The background should be #fc0, not #f00.
10.Fix the swapped coloursbug fix · easy · 8 min · practice plan
The light colour belongs on the text.
Passes when: The light colour belongs on the text.
Between them these tasks cover Six-digit hex, Three-digit shorthand and Reading hex channels.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.