Magento 2 Experten — Hyvä Theme, Tailwind CSS & SEO aus einer Hand ›

Line Breaks and Dividers: <br> and <hr>

Line Breaks and Dividers: <br> and <hr>

~6 Min. Lesezeit Zuletzt aktualisiert am August 8, 2026

In this chapter you'll learn two small elements that both share something special: they don't need a closing tag.

<br>: a line break

Sometimes you want to force a line break at a specific spot within a single paragraph, for example in an address or a poem. That's what <br> ("break") is for:

<p>Finn Müller<br>
  12 Sample Street<br>
  12345 Sample Town</p>

Notice: <br> has no closing </br>. It's what's called a "self-closing" element - it stands entirely on its own, with no content in between, because it doesn't have any content itself. It only marks a single spot in the text.

Achtung: Don't use <br> to create spacing between two completely different topics (that's what multiple <p> elements are for). <br> is only meant for line breaks within a piece of connected text, like an address.

<hr>: a divider

<hr> ("horizontal rule") draws a thin horizontal line across the full width and marks a thematic transition - basically "a new topic starts here".

<p>That was the last paragraph on the old topic.</p>
<hr>
<p>And here a completely new topic begins.</p>

<hr> also has no closing tag - just like <br>, it's a single, self-contained element.

Trying both on Finn's website

Add a small contact note with an address at the end of the page, separated by a line:

index.html
<h3>Our Achievements</h3>
<p>Last year we came second in our league.</p>

<hr>

<p>Finn Müller<br>
  12 Sample Street<br>
  12345 Sample Town</p>

Tipp: Rule of thumb for later: both <br> and <hr> should be used sparingly. If you notice you're using many <br> in a row just to create spacing, that's often a sign that a list (which you'll learn about next) would actually be the better choice.