HTML Div & Span — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the HTML Div & Span 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
Group a block with a div
easy10 minWrap two paragraphs in a div.
- 2
Target text with a span
easy10 minWrap one word in a span with a class.
- 3
Give a div a class
easy10 minAdd a div with the class "card".
- 4
Nest a span inside a div
easy10 minPut a span inside a div's paragraph.
- 5
Prefer semantics where possible
medium10 minUse a section instead of a div for a titled block.
Find the bug(5)
- 1
Fix the span wrapping blocks
easy8 minA span cannot contain paragraphs.
- 2
Fix the div used inline
easy8 minHighlighting a word inline needs a span.
- 3
Fix the div where a section belongs
easy8 minA titled block should be a section.
- 4
Fix the missing class
easy8 minThe wrapper has no class to target.
- 5
Fix the div used as a list
easy8 minRepeated items should be a real list.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace