Give #box a red shadow offset 2px right, 4px down, blurred 6px.
Acceptance criteria
- 1.Give #box a red shadow offset 2px right, 4px down, blurred 6px.
CSS Tutorial · CSS Effects
These 10 tasks go with the CSS Shadows 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: “The CSS Shadows properties are used to add shadow effects to elements and text on a webpage.” Read the chapter.
1.Add a box shadowexercise · easy · 10 min
Give #box a red shadow offset 2px right, 4px down, blurred 6px.
Passes when: Give #box a red shadow offset 2px right, 4px down, blurred 6px.
2.Add an inner shadowexercise · easy · 10 min · practice plan
Give #box a 10px blue glow on the inside.
Passes when: Give #box a 10px blue glow on the inside.
3.Add a text shadowexercise · easy · 10 min · practice plan
Give #text a black shadow 1px right, 1px down, blurred 2px.
Passes when: Give #text a black shadow 1px right, 1px down, blurred 2px.
4.Layer two shadowsexercise · easy · 10 min · practice plan
A red shadow at 2px and a blue one at 4px, with no blur.
Passes when: A red shadow at 2px and a blue one at 4px, with no blur.
5.Build a subtle elevationexercise · medium · 10 min · practice plan
A soft shadow: no x offset, 1px down, 2px blur, black at 20%.
Passes when: A soft shadow: no x offset, 1px down, 2px blur, black at 20%.
6.Fix the missing unitsbug fix · easy · 8 min
Shadow offsets need units.
Passes when: Shadow offsets need units.
7.Fix the misspelled keywordbug fix · easy · 8 min · practice plan
An inner shadow uses the keyword inset.
Passes when: An inner shadow uses the keyword inset.
8.Fix box-shadow used on textbug fix · easy · 8 min · practice plan
Text needs text-shadow.
Passes when: Text needs text-shadow.
9.Fix the missing commabug fix · easy · 8 min · practice plan
Multiple shadows are separated by commas.
Passes when: Multiple shadows are separated by commas.
10.Fix the harsh shadowbug fix · easy · 8 min · practice plan
The shadow should be black at 20%, not solid black.
Passes when: The shadow should be black at 20%, not solid black.
Between them these tasks cover box-shadow, text-shadow and Inset and layered shadows.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.