0
0
HTMLmarkup~20 mins

Line breaks and horizontal rules in HTML - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Line Breaks and Rules Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
What is the visual output of this HTML snippet?
Look at this HTML code and choose what you will see in the browser.
HTML
<p>Hello<br>World</p>
AHello and World appear on the same line with a space between.
BOnly Hello appears; World is hidden.
CHelloWorld appears as one word with no space.
DHello and World appear on two separate lines.
Attempts:
2 left
💡 Hint
The
tag creates a line break inside text.
📝 Syntax
intermediate
2:00remaining
Which option correctly adds a horizontal rule in HTML?
Choose the correct HTML tag that creates a horizontal line across the page.
A<line>
B<break>
C<hr>
D<hline>
Attempts:
2 left
💡 Hint
The horizontal rule tag is a self-closing tag with two letters.
🧠 Conceptual
advanced
2:00remaining
What is the difference between
and
in HTML?
Choose the option that best explains the difference between these two tags.
A<br> inserts a line break inside text; <hr> inserts a horizontal line separating content sections.
B<br> creates a horizontal line; <hr> creates a line break inside text.
C<br> and <hr> both create horizontal lines but with different thickness.
D<br> is used for paragraphs; <hr> is used for line breaks.
Attempts:
2 left
💡 Hint
Think about how text flows and how sections are separated visually.
accessibility
advanced
2:00remaining
How should you improve accessibility when using
tags?
Which option is the best practice to make horizontal rules accessible to screen readers?
AUse <hr> without any attributes; screen readers ignore it automatically.
BAdd an aria-label or role="separator" to describe the purpose of the <hr>.
CReplace <hr> with multiple <br> tags for better accessibility.
DAdd a title attribute with decorative text to the <hr>.
Attempts:
2 left
💡 Hint
Think about how screen readers understand page structure.
selector
expert
2:00remaining
Which CSS selector targets only
elements inside paragraphs?
Choose the CSS selector that applies styles only to
tags that are inside

tags.

Ap br
Bbr p
Cp > br
Dp + br
Attempts:
2 left
💡 Hint
Think about descendant selectors versus child selectors.