Reset a counter named section to 0 on #list.
Acceptance criteria
- 1.Reset a counter named section to 0 on #list.
CSS Tutorial · Modern CSS Authoring
These 10 tasks go with the Generated Content 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: “Add presentational markers and automatic numbering with pseudo-elements, content, and counters. You will create decorative pseudo-element content, automatic numbering, custom marker systems, and safer list markers with ::marker.” .
1.Start a counterexercise · easy · 10 min
Reset a counter named section to 0 on #list.
Passes when: Reset a counter named section to 0 on #list.
2.Start from a numberexercise · easy · 10 min · practice plan
Reset a counter named step to 5 on #list.
Passes when: Reset a counter named step to 5 on #list.
3.Increment a counterexercise · easy · 10 min · practice plan
Increment section by 1 on each .item.
Passes when: Increment section by 1 on each .item.
4.Increment by twoexercise · easy · 10 min · practice plan
Increment section by 2 on each .item.
Passes when: Increment section by 2 on each .item.
5.Set up a numbered listexercise · medium · 10 min · practice plan
Reset section on the list and increment it on each item.
Passes when: Reset section on the list and increment it on each item.
6.Fix the misspelled propertybug fix · easy · 8 min
The property is counter-reset.
Passes when: The property is counter-reset.
7.Fix the wrong start valuebug fix · easy · 8 min · practice plan
The counter should begin at 5.
Passes when: The counter should begin at 5.
8.Fix reset used instead of incrementbug fix · easy · 8 min · practice plan
Each item should advance the counter, not restart it.
Passes when: Each item should advance the counter, not restart it.
9.Fix the increment stepbug fix · easy · 8 min · practice plan
The counter should advance by 2.
Passes when: The counter should advance by 2.
10.Fix the counter on the wrong elementbug fix · easy · 8 min · practice plan
The list resets it; the items increment it.
Passes when: The list resets it; the items increment it.
Between them these tasks cover counter-reset, counter-increment and The content property.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.