Episode 12 of 17

Line Breaks and HR Tags

Learn how to use line breaks and horizontal rules in HTML to control spacing and visually separate content on your pages.

Sometimes you need to break text onto a new line or visually separate sections without starting a new paragraph. HTML gives you two tags for this.

Line Breaks: <br>

The <br> tag forces text onto a new line without creating a new paragraph:

<p>Roses are red,<br>
Violets are blue,<br>
HTML is awesome,<br>
And so are you.</p>

When to Use <br>

  • Poems and song lyrics
  • Addresses
  • Short line-by-line content

When NOT to Use <br>

Never use multiple <br> tags for spacing. Use CSS margin or padding instead:

<!-- ❌ BAD -->
<p>Some text</p><br><br><br><p>More text</p>

<!-- ✅ GOOD (use CSS) -->
<p style="margin-bottom: 2rem;">Some text</p>
<p>More text</p>

Horizontal Rules: <hr>

The <hr> tag creates a horizontal line to visually separate sections:

<h2>Chapter 1</h2>
<p>Chapter one content...</p>
<hr>
<h2>Chapter 2</h2>
<p>Chapter two content...</p>

The <hr> represents a thematic break — a change in topic or section. Both <br> and <hr> are self-closing tags.