Set box-sizing on every element.
Acceptance criteria
- 1.Set box-sizing on every element.
CSS Tutorial · CSS Selectors
These 10 tasks go with the CSS Universal Selector 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: “Use the universal selector deliberately for box-sizing resets, scoped defaults, and namespace-aware matching without applying unnecessary rules everywhere.” .
1.Reset with the universal selectorexercise · easy · 10 min
Set box-sizing on every element.
Passes when: Set box-sizing on every element.
2.Zero every marginexercise · easy · 10 min · practice plan
Remove margins from all elements.
Passes when: Remove margins from all elements.
3.Scope the universal selectorexercise · easy · 10 min · practice plan
Make every element inside #one red.
Passes when: Make every element inside #one red.
4.Set a shared font sizeexercise · easy · 10 min · practice plan
Give every element a 20px font size.
Passes when: Give every element a 20px font size.
5.Combine universal with a classexercise · medium · 10 min · practice plan
Target every descendant of .card.
Passes when: Target every descendant of .card.
6.Fix the wrong wildcard characterbug fix · easy · 8 min
The universal selector is *, not %.
Passes when: The universal selector is *, not %.
7.Fix the universal used where a class was meantbug fix · easy · 8 min · practice plan
This resets everything instead of just the cards.
Passes when: This resets everything instead of just the cards.
8.Fix the missing spacebug fix · easy · 8 min · practice plan
Without a space this targets an element that is both.
Passes when: Without a space this targets an element that is both.
9.Fix the reset that missedbug fix · easy · 8 min · practice plan
Only paragraphs got the padding; every element was intended.
Passes when: Only paragraphs got the padding; every element was intended.
10.Fix the misspelled property in the resetbug fix · easy · 8 min · practice plan
The property is box-sizing.
Passes when: The property is box-sizing.
Between them these tasks cover Universal selector, Resets and Scoped universals.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.