Wrap one word in a classed span.
Acceptance criteria
- 1.Wrap one word in a classed span.
HTML Tutorial · HTML Tags
These 10 tasks go with the HTML <span> Tag 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: “is a hook. It wraps a piece of text so you can point CSS or JavaScript at that piece and nothing else. On its own it changes nothing — no line break, no spacing, no meaning. That is the point of it.” .
1.Style part of a sentenceexercise · easy · 10 min
Wrap one word in a classed span.
Passes when: Wrap one word in a classed span.
2.Two styled wordsexercise · easy · 10 min · practice plan
Give two words the same class.
Passes when: Give two words the same class.
3.Use a semantic element insteadexercise · easy · 10 min · practice plan
Importance is strong, not a span.
Passes when: Importance is strong, not a span.
4.A span in a listexercise · easy · 10 min · practice plan
Wrap part of a list item in a span.
Passes when: Wrap part of a list item in a span.
5.A badge inside a headingexercise · medium · 10 min · practice plan
Add a classed span inside a heading.
Passes when: Add a classed span inside a heading.
6.Fix the inline style used for a repeated lookbug fix · easy · 8 min
A reusable look belongs in a class.
Passes when: A reusable look belongs in a class.
7.Fix the second word left unstyledbug fix · easy · 8 min · practice plan
Both words should carry the class.
Passes when: Both words should carry the class.
8.Fix the span used for importancebug fix · easy · 8 min · practice plan
There is a real element for this meaning.
Passes when: There is a real element for this meaning.
9.Fix the div used inside a line of textbug fix · easy · 8 min · practice plan
An inline wrapper is a span, not a div.
Passes when: An inline wrapper is a span, not a div.
10.Fix the badge outside the headingbug fix · easy · 8 min · practice plan
The badge is part of the heading text.
Passes when: The badge is part of the heading text.
Between them these tasks cover Inline containers, Styling hooks and When not to use one.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.