Give #box a 3px solid outline.
Acceptance criteria
- 1.Give #box a 3px solid outline.
CSS Tutorial · CSS Box Model
These 10 tasks go with the CSS Outline 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: “Draw non-layout outlines for focus and emphasis, control their offset, and preserve accessible keyboard focus indicators.” Read the chapter.
1.Add an outlineexercise · easy · 10 min
Give #box a 3px solid outline.
Passes when: Give #box a 3px solid outline.
2.Use a dashed outlineexercise · easy · 10 min · practice plan
Give #box a 2px dashed outline.
Passes when: Give #box a 2px dashed outline.
3.Offset the outlineexercise · easy · 10 min · practice plan
Push the outline 4px away from the box.
Passes when: Push the outline 4px away from the box.
4.Colour the outlineexercise · easy · 10 min · practice plan
Give #box a red outline.
Passes when: Give #box a red outline.
5.Outline without moving the layoutexercise · medium · 10 min · practice plan
Add a 5px outline and confirm the box keeps zero border width.
Passes when: Add a 5px outline and confirm the box keeps zero border width.
6.Fix the removed focus outlinebug fix · easy · 8 min
Removing the outline entirely harms keyboard users.
Passes when: Removing the outline entirely harms keyboard users.
7.Fix the border used as an outlinebug fix · easy · 8 min · practice plan
A border shifts the layout; an outline does not.
Passes when: A border shifts the layout; an outline does not.
8.Fix the outline with no stylebug fix · easy · 8 min · practice plan
Without a style the outline never renders.
Passes when: Without a style the outline never renders.
9.Fix the wrong offset propertybug fix · easy · 8 min · practice plan
The property is outline-offset, not outline-gap.
Passes when: The property is outline-offset, not outline-gap.
10.Fix the invalid outline colourbug fix · easy · 8 min · practice plan
"reddish" is not a colour, so the declaration is dropped.
Passes when: "reddish" is not a colour, so the declaration is dropped.
Between them these tasks cover Outline vs border, Focus visibility and outline-offset.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.