Give #box a 2px solid red border.
Acceptance criteria
- 1.Give #box a 2px solid red border.
CSS Tutorial · CSS Box Model
These 10 tasks go with the CSS Border 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: “Build borders with width, style, color, radius, logical sides, and shorthands while accounting for their effect on box dimensions.” Read the chapter.
1.Add a solid borderexercise · easy · 10 min
Give #box a 2px solid red border.
Passes when: Give #box a 2px solid red border.
2.Border one side onlyexercise · easy · 10 min · practice plan
Give #box a 4px solid bottom border.
Passes when: Give #box a 4px solid bottom border.
3.Round the cornersexercise · easy · 10 min · practice plan
Give #box an 8px border radius.
Passes when: Give #box an 8px border radius.
4.Use a dashed borderexercise · easy · 10 min · practice plan
Give #box a 3px dashed border.
Passes when: Give #box a 3px dashed border.
5.Make a circleexercise · medium · 10 min · practice plan
Give #box a 50% radius and equal width and height.
Passes when: Give #box a 50% radius and equal width and height.
6.Fix the border with no stylebug fix · easy · 8 min
Without a style the border has no width at all.
Passes when: Without a style the border has no width at all.
7.Fix the misspelled stylebug fix · easy · 8 min · practice plan
"solidd" is not a valid border style.
Passes when: "solidd" is not a valid border style.
8.Fix the wrong radius propertybug fix · easy · 8 min · practice plan
The property is border-radius, not corner-radius.
Passes when: The property is border-radius, not corner-radius.
9.Fix the border on the wrong sidebug fix · easy · 8 min · practice plan
The border was applied to the top instead of the bottom.
Passes when: The border was applied to the top instead of the bottom.
10.Fix the missing border widthbug fix · easy · 8 min · practice plan
A border declared with only a colour renders at the default width.
Passes when: A border declared with only a colour renders at the default width.
Between them these tasks cover Border shorthand, Border style and Border radius.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.