Horizontal Rules with <hr>
A free lesson from Swipe Coding · HTML, level 2 · updated October 2026
By the Swipe team, founded by Colin · how we make lessons
The <hr> element draws a horizontal line across the page. Visually it looks decorative, but its actual meaning is a thematic break — a signal that the content before it and the content after it are about a different topic.
<p>End of Chapter 3.</p> <hr> <p>Chapter 4 begins here.</p>
Like <br> and <img>, <hr> is a void element — it has no content to wrap, so it never gets a closing tag. If you just want a plain decorative line with no topic change implied, that's a job for a CSS border, not <hr>.
<hr>
It's easy to reach for <hr> purely because a line looks nice between two sections, but that misses its purpose. Using it correctly — for an actual shift in topic — keeps the semantic meaning of your page intact for tools that rely on it, the same reasoning behind choosing <strong> over <b>.
What does <hr> semantically represent, beyond just drawing a line?
<hr> requires a closing tag, like </hr>.
If you only want a decorative line with no real change of topic, that is better handled with ____ instead of <hr>.
Emphasis, Breaks, and Rules
10 questions · pass with 60% — just like in the app.
What is the key difference between <strong> and <b>?
A screen reader treats <strong> text exactly the same as <b> text, since they look identical in a browser.
Use ____ when text is genuinely important, and reserve <b> for text that should just look bold with no real significance.
Which of these is the correct use of <em>?
<em> and <i> always mean exactly the same thing, just with different tag names.
Setting a foreign word or a ship's name in italics with no vocal stress implied calls for ____, not <em>.
What does <br> do?
<br> is a void element, meaning it never needs a closing tag.
What does <hr> semantically represent, beyond just drawing a line?
<hr> requires a closing tag, like </hr>.
Keep your streak going in Swipe Coding
Swipe through every level of HTML on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.
Get the Swipe apps →