Give #box a #f0f0f0 background.
Acceptance criteria
- 1.Give #box a #f0f0f0 background.
CSS Tutorial · CSS Colors and Backgrounds
These 10 tasks go with the CSS Background Color 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: “Set background colors on elements while accounting for transparency, inherited text color, contrast, and the area painted by the background.” .
1.Set a backgroundexercise · easy · 10 min
Give #box a #f0f0f0 background.
Passes when: Give #box a #f0f0f0 background.
2.Use a translucent backgroundexercise · easy · 10 min · practice plan
Give #box a black background at 50% opacity.
Passes when: Give #box a black background at 50% opacity.
3.Match the text colourexercise · easy · 10 min · practice plan
Make the #box background follow its text colour, which is red.
Passes when: Make the #box background follow its text colour, which is red.
4.Colour the wrapperexercise · easy · 10 min · practice plan
Give #wrap a #fffbe6 background.
Passes when: Give #wrap a #fffbe6 background.
5.Build a readable panelexercise · medium · 10 min · practice plan
Dark #1a1a1a background with #fafafa text.
Passes when: Dark #1a1a1a background with #fafafa text.
6.Fix the shorthand that wiped the colourbug fix · easy · 8 min
A later background shorthand resets background-color.
Passes when: A later background shorthand resets background-color.
7.Fix the alpha in a hex colourbug fix · easy · 8 min · practice plan
Use rgba() to get a half-transparent black.
Passes when: Use rgba() to get a half-transparent black.
8.Fix the misspelled keywordbug fix · easy · 8 min · practice plan
The keyword is currentColor.
Passes when: The keyword is currentColor.
9.Fix the colour on the wrong elementbug fix · easy · 8 min · practice plan
The wrapper should carry the cream background.
Passes when: The wrapper should carry the cream background.
10.Fix the unreadable pairingbug fix · easy · 8 min · practice plan
Dark text on a dark background cannot be read.
Passes when: Dark text on a dark background cannot be read.
Between them these tasks cover background-color, Alpha backgrounds and currentColor.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.