CSS Outline — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS Outline lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Exercises(5)
- 1
Add an outline
easy10 minGive #box a 3px solid outline.
- 2
Use a dashed outline
easy10 minGive #box a 2px dashed outline.
- 3
Offset the outline
easy10 minPush the outline 4px away from the box.
- 4
Colour the outline
easy10 minGive #box a red outline.
- 5
Outline without moving the layout
medium10 minAdd a 5px outline and confirm the box keeps zero border width.
Find the bug(5)
- 1
Fix the removed focus outline
easy8 minRemoving the outline entirely harms keyboard users.
- 2
Fix the border used as an outline
easy8 minA border shifts the layout; an outline does not.
- 3
Fix the outline with no style
easy8 minWithout a style the outline never renders.
- 4
Fix the wrong offset property
easy8 minThe property is outline-offset, not outline-gap.
- 5
Fix the invalid outline colour
easy8 min"reddish" is not a colour, so the declaration is dropped.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace