Add a div containing a paragraph.
Acceptance criteria
- 1.Add a div containing a paragraph.
HTML Tutorial · HTML Layout
These 10 tasks go with the HTML Block vs Inline Elements 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: “In HTML, every element is defined as either a block-level element or an inline element . Understanding the difference between them is essential for controlling page layout, spacing, and structure effectively.” .
1.Use a block elementexercise · easy · 10 min
Add a div containing a paragraph.
Passes when: Add a div containing a paragraph.
2.Use an inline elementexercise · easy · 10 min · practice plan
Highlight a word inside a paragraph with a span.
Passes when: Highlight a word inside a paragraph with a span.
3.Nest inline inside blockexercise · easy · 10 min · practice plan
Put a strong element inside a paragraph.
Passes when: Put a strong element inside a paragraph.
4.Use a list as a blockexercise · easy · 10 min · practice plan
Add a ul with two items.
Passes when: Add a ul with two items.
5.Combine block and inlineexercise · medium · 10 min · practice plan
Add a section with a paragraph containing a link.
Passes when: Add a section with a paragraph containing a link.
6.Fix the block inside a paragraphbug fix · easy · 8 min
A div cannot live inside a paragraph.
Passes when: A div cannot live inside a paragraph.
7.Fix the span used as a containerbug fix · easy · 8 min · practice plan
A layout wrapper should be a block element.
Passes when: A layout wrapper should be a block element.
8.Fix the div used for emphasisbug fix · easy · 8 min · practice plan
Inline emphasis belongs in a span or strong.
Passes when: Inline emphasis belongs in a span or strong.
9.Fix the list items in a divbug fix · easy · 8 min · practice plan
List items need a real list parent.
Passes when: List items need a real list parent.
10.Fix the link wrapping a sectionbug fix · easy · 8 min · practice plan
Keep the link inline inside the paragraph.
Passes when: Keep the link inline inside the paragraph.
Between them these tasks cover Block elements, Inline elements and Valid nesting.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.