Show two indented lines with their spacing preserved.
Acceptance criteria
- 1.Show two indented lines with their spacing preserved.
HTML Tutorial · HTML Tags
These 10 tasks go with the HTML <pre> 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: “The <pre> tag in HTML defines preformatted text — meaning the text inside it is displayed exactly as written in the HTML file, including spaces, tabs, and line breaks. It is often used to display code snippets, poems, or any text where spacing and alignment matter.” .
1.Keep the spacingexercise · easy · 10 min
Show two indented lines with their spacing preserved.
Passes when: Show two indented lines with their spacing preserved.
2.A code blockexercise · easy · 10 min · practice plan
Put code inside a preformatted block.
Passes when: Put code inside a preformatted block.
3.ASCII artexercise · easy · 10 min · practice plan
Show a small block of ASCII art.
Passes when: Show a small block of ASCII art.
4.Preformatted inside a figureexercise · easy · 10 min · practice plan
Put a code block inside a figure with a caption.
Passes when: Put a code block inside a figure with a caption.
5.Two code blocksexercise · medium · 10 min · practice plan
Show two separate preformatted blocks.
Passes when: Show two separate preformatted blocks.
6.Fix the paragraph used for spaced textbug fix · easy · 8 min
A paragraph collapses the spacing.
Passes when: A paragraph collapses the spacing.
7.Fix the code with no preformattingbug fix · easy · 8 min · practice plan
Code keeps its line breaks inside pre.
Passes when: Code keeps its line breaks inside pre.
8.Fix the breaks used to keep layoutbug fix · easy · 8 min · practice plan
Preformatted text does not need break tags.
Passes when: Preformatted text does not need break tags.
9.Fix the caption outside the figurebug fix · easy · 8 min · practice plan
The caption belongs with its code block.
Passes when: The caption belongs with its code block.
10.Fix the two commands in one blockbug fix · easy · 8 min · practice plan
Two separate commands are two blocks.
Passes when: Two separate commands are two blocks.
Between them these tasks cover Preformatted text, Whitespace and Code blocks.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.