Wrap two paragraphs in a div.
Acceptance criteria
- 1.Wrap two paragraphs in a div.
HTML Tutorial · HTML Layout
These 10 tasks go with the HTML Div & Span 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: “The and elements are two of the most commonly used tags in HTML. They do not add any visual change by themselves but are extremely useful for grouping content , styling , and layout control using CSS.” .
1.Group a block with a divexercise · easy · 10 min
Wrap two paragraphs in a div.
Passes when: Wrap two paragraphs in a div.
2.Target text with a spanexercise · easy · 10 min · practice plan
Wrap one word in a span with a class.
Passes when: Wrap one word in a span with a class.
3.Give a div a classexercise · easy · 10 min · practice plan
Add a div with the class "card".
Passes when: Add a div with the class "card".
4.Nest a span inside a divexercise · easy · 10 min · practice plan
Put a span inside a div's paragraph.
Passes when: Put a span inside a div's paragraph.
5.Prefer semantics where possibleexercise · medium · 10 min · practice plan
Use a section instead of a div for a titled block.
Passes when: Use a section instead of a div for a titled block.
6.Fix the span wrapping blocksbug fix · easy · 8 min
A span cannot contain paragraphs.
Passes when: A span cannot contain paragraphs.
7.Fix the div used inlinebug fix · easy · 8 min · practice plan
Highlighting a word inline needs a span.
Passes when: Highlighting a word inline needs a span.
8.Fix the div where a section belongsbug fix · easy · 8 min · practice plan
A titled block should be a section.
Passes when: A titled block should be a section.
9.Fix the missing classbug fix · easy · 8 min · practice plan
The wrapper has no class to target.
Passes when: The wrapper has no class to target.
10.Fix the div used as a listbug fix · easy · 8 min · practice plan
Repeated items should be a real list.
Passes when: Repeated items should be a real list.
Between them these tasks cover div vs span and When to use generic elements.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.