The <br> tag is used to insert a line break in HTML. It forces the text to continue on the next line.
Click to reveal answer
beginner
What does the <hr> tag do in HTML?
The <hr> tag creates a horizontal rule, which is a horizontal line used to separate content visually.
Click to reveal answer
beginner
Is the <br> tag self-closing or does it need a closing tag?
The <br> tag is self-closing, meaning it does not need a separate closing tag like </br>.
Click to reveal answer
beginner
Can you use multiple <br> tags to add extra space between lines?
Yes, you can use multiple <br> tags in a row to add extra line breaks and create more vertical space.
Click to reveal answer
beginner
What is a good real-life example of when to use <hr> in a webpage?
Use <hr> to separate sections of content, like dividing an article into parts or separating a header from the main content, similar to drawing a line on paper to separate ideas.
Click to reveal answer
Which tag inserts a line break in HTML?
A<line>
B<hr>
C<break>
D<br>
✗ Incorrect
The <br> tag creates a line break. The others do not.
What does the <hr> tag create?
AA paragraph
BA horizontal line
CA line break
DA vertical line
✗ Incorrect
The <hr> tag creates a horizontal rule, which is a horizontal line.
Is the <br> tag a self-closing tag?
ANo
BOnly in XHTML
CYes
DOnly in HTML4
✗ Incorrect
In HTML5, <br> is self-closing and does not need a closing tag.
Which tag would you use to separate two sections of content visually?
A<hr>
B<br>
C<div>
D<span>
✗ Incorrect
<hr> creates a visible horizontal line to separate content.
How can you add extra vertical space between lines?
AUse multiple <code><br></code> tags
BUse multiple <code><hr></code> tags
CUse <code><line></code> tags
DUse <code><break></code> tags
✗ Incorrect
Multiple <br> tags add extra line breaks and vertical space.
Explain how to use <br> and <hr> tags in HTML and when to use each.
Think about breaking lines vs separating sections.
You got /3 concepts.
Describe the visual effect of <br> and <hr> tags on a webpage.
Imagine reading a book or article.
You got /3 concepts.
Practice
(1/5)
1. What does the <br> tag do in HTML?
easy
A. It makes text bold.
B. It adds a line break inside text.
C. It creates a horizontal line across the page.
D. It inserts an image.
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 B
Quick 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
A.
B. <hl>
C. <line>
D.
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 D
Quick 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
A. Hello and World on the same line, then a horizontal line, then Goodbye below.
B. Hello and World on the same line, no horizontal line, then Goodbye below.
C. Hello and World on separate lines, then a horizontal line, then Goodbye below.
D. Hello and World on separate lines, no horizontal line, then Goodbye below.
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 C
Quick 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
A. Using <hr> inside a <p> tag is invalid HTML.
B. <br> tag is missing a closing tag.
C. <hr> should be written as <hr/> to work.
D. <p> tag should be closed before <br>.
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 A
Quick 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
A.
First paragraph.
Second paragraph.
B.
First paragraph.
Second paragraph.
C.
First paragraph.
Second paragraph.
D.
First paragraph.
<br>
Second paragraph.
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 A
Quick 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 unknownstrongwhile earning +1 Grip toward your certificate.