Swipe
SwipeSwipe
Swipe Apps

Paths

Motivation

Information

Emphasis, Breaks, and Rules · Lesson 18 of 18

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>
The <hr> marks a shift between two unrelated sections of content.
🤖
It's a semantic scene change, not just a decorative line. 🎬

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>
A complete, valid <hr> — nothing more is needed.

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>.

Quick check

What does <hr> semantically represent, beyond just drawing a line?

True or false

<hr> requires a closing tag, like </hr>.

Fill in the blank

If you only want a decorative line with no real change of topic, that is better handled with ____ instead of <hr>.

Chapter quiz

Emphasis, Breaks, and Rules

10 questions · pass with 60% — just like in the app.

Quick check

What is the key difference between <strong> and <b>?

True or false

A screen reader treats <strong> text exactly the same as <b> text, since they look identical in a browser.

Fill in the blank

Use ____ when text is genuinely important, and reserve <b> for text that should just look bold with no real significance.

Quick check

Which of these is the correct use of <em>?

True or false

<em> and <i> always mean exactly the same thing, just with different tag names.

Fill in the blank

Setting a foreign word or a ship's name in italics with no vocal stress implied calls for ____, not <em>.

Quick check

What does <br> do?

True or false

<br> is a void element, meaning it never needs a closing tag.

Quick check

What does <hr> semantically represent, beyond just drawing a line?

True or false

<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 →