Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to add a line break between two sentences.
HTML
<p>Hello, world![1]Welcome to web development.</p>Attempts:
3 left
💡 Hint
Common Mistakes
Using
instead of
which creates a horizontal line, not a line break.
instead of
which creates a horizontal line, not a line break.
Using
or
which create block elements, not simple line breaks.
✗ Incorrect
The
tag inserts a line break, moving the next content to a new line without starting a new paragraph.
tag inserts a line break, moving the next content to a new line without starting a new paragraph.
2fill in blank
mediumComplete the code to add a horizontal rule between two sections.
HTML
<section>First section content.</section>[1]<section>Second section content.</section>Attempts:
3 left
💡 Hint
Common Mistakes
Using
which only breaks the line but does not create a horizontal line.
which only breaks the line but does not create a horizontal line.
Using
or which do not create horizontal lines.
✗ Incorrect
The
tag creates a horizontal line that visually separates content sections.
tag creates a horizontal line that visually separates content sections.
3fill in blank
hardFix the error in the code to correctly add a line break.
HTML
<p>Line one[1]Line two</p>Attempts:
3 left
💡 Hint
Common Mistakes
Using which is not a valid HTML tag.
Using
which creates a horizontal line, not a line break.
which creates a horizontal line, not a line break.
✗ Incorrect
In HTML5,
and
both work, but
is the XHTML-style self-closing tag and often preferred for clarity.
and
both work, but
is the XHTML-style self-closing tag and often preferred for clarity.
4fill in blank
hardFill both blanks to add a line break and a horizontal rule between paragraphs.
HTML
<p>Paragraph one.</p>[1]<hr>[2]<p>Paragraph two.</p>
Attempts:
3 left
💡 Hint
Common Mistakes
Using
which creates a block element, not a line break.
Using
in blanks which duplicates the horizontal rule.
in blanks which duplicates the horizontal rule.
✗ Incorrect
Use
for a line break and
for another line break. The
is already present between paragraphs.
for a line break and
for another line break. The
is already present between paragraphs.
5fill in blank
hardFill all three blanks to create a structure with a horizontal rule and two line breaks.
HTML
<header>Welcome</header>[1]<hr>[2]<p>Content starts here.[3]</p>
Attempts:
3 left
💡 Hint
Common Mistakes
Using
which does not create line breaks.
Using
in blanks which duplicates the horizontal rule.
in blanks which duplicates the horizontal rule.
✗ Incorrect
Use
for the first and second blanks to add line breaks before and after the horizontal rule, and
inside the paragraph for a line break.
for the first and second blanks to add line breaks before and after the horizontal rule, and
inside the paragraph for a line break.
Practice
1. What does the
<br> tag do in HTML?easy
Solution
Step 1: Understand the purpose of <br>
The <br> tag is used to break a line and continue text on the next line.Step 2: Compare with other tags
The <hr> tag creates a horizontal line, not a line break. Bold text uses <strong> or <b> tags. Images use <img> tag.Final Answer:
It adds a line break inside text. -> Option BQuick Check:
<br> = line break [OK]
Hint: Remember: <br> breaks line, <hr> draws line [OK]
Common Mistakes:
- Confusing <br> with <hr>
- Thinking <br> makes text bold
- Using <br> to insert images
2. Which of the following is the correct syntax to add a horizontal rule in HTML?
easy
Solution
Step 1: Identify the tag for horizontal rule
The correct tag to add a horizontal line is <hr>.Step 2: Check other options
<br> adds a line break, <line> and <hl> are not valid HTML tags.Final Answer:
<hr> -> Option DQuick Check:
<hr> = horizontal rule [OK]
Hint: Use <hr> for horizontal lines, not <br> [OK]
Common Mistakes:
- Using <br> instead of <hr>
- Typing invalid tags like <line> or <hl>
- Forgetting <hr> is self-closing
3. What will the following HTML code display?
<p>Hello<br>World<hr><p>Goodbye</p>
medium
Solution
Step 1: Analyze <br> effect
The <br> tag breaks the line between "Hello" and "World", so they appear on separate lines.Step 2: Analyze <hr> effect
The <hr> tag adds a horizontal line below "World" before the next paragraph "Goodbye".Final Answer:
Hello and World on separate lines, then a horizontal line, then Goodbye below. -> Option CQuick Check:
<br> = line break, <hr> = horizontal line [OK]
Hint: <br> breaks line, <hr> draws line below [OK]
Common Mistakes:
- Thinking <br> keeps text on same line
- Ignoring the horizontal line from <hr>
- Confusing paragraph tags with line breaks
4. Find the error in this HTML snippet:
<p>Line one<br><hr>Line two</p>
medium
Solution
Step 1: Check tag nesting rules
The <hr> tag is a block-level element and should not be inside a <p> tag, which is for text paragraphs.Step 2: Validate other tags
<br> is self-closing and does not need a closing tag. <hr> can be written as <hr> or <hr/> in HTML5. <p> can contain <br> but not <hr>.Final Answer:
Using <hr> inside a <p> tag is invalid HTML. -> Option AQuick Check:
<hr> not allowed inside <p> [OK]
Hint: Block tags like <hr> can't go inside <p> [OK]
Common Mistakes:
- Thinking <br> needs closing tag
- Believing <hr> must be self-closed
- Ignoring tag nesting rules
5. You want to separate two paragraphs with a visible line and also add a blank line between them. Which HTML code achieves this correctly?
hard
Solution
Step 1: Understand spacing and line rules
To add a blank line, use a <br> inside a paragraph or a separate paragraph with <br>.Step 2: Place horizontal rule correctly
The <hr> tag should be outside paragraphs to separate them visually.Step 3: Evaluate options
First paragraph.
Second paragraph.
uses <br> outside paragraphs which is invalid.First paragraph.
Second paragraph.
misses blank line.First paragraph.
<br>
Second paragraph.
uses literal <br> text, not tag.First paragraph.
Second paragraph.
correctly uses a paragraph with <br> for spacing and <hr> between paragraphs.Final Answer:
<p>First paragraph.</p><p><br></p><hr><p>Second paragraph.</p> -> Option AQuick Check:
Use <p><br></p> for blank line, <hr> outside paragraphs [OK]
Hint: Use <p><br></p> for space, <hr> between paragraphs [OK]
Common Mistakes:
- Placing <br> outside paragraphs
- Using literal <br> text instead of tag
- Putting <hr> inside paragraphs
Recommended
Ready to prove it?
Pass the test and this pattern moves unknown
10 questions ~5 mineasy hard
