Line Breaks and Horizontal Rules

Break a line with br and add a divider with hr.

SyntaxLine one<br>Line two<hr>

The <br> element creates a line break without starting a new paragraph. It is an empty element with no closing tag.

The <hr> element draws a horizontal rule — a line that separates content, often marking a change of topic.

Example

Try it yourself
Loading editor…
Press Run to see the result.

When to use it

  • A developer uses <br> to format a mailing address so each line appears on its own without a new paragraph.
  • A poet marks up verse stanzas using <br> between lines inside a single <p> to preserve the poem formatting.
  • A form label uses <br> to stack a field name above a helper hint without creating a separate paragraph element.

More examples

Address formatted with br

<br> inserts a line break so each address line appears below the previous one in a single paragraph.

Example · html
<p>
  SoundsCode Inc.<br>
  42 Tutorial Lane<br>
  San Francisco, CA 94105<br>
  USA
</p>

Poem verse with line breaks

Using <br> instead of <p> for each line keeps the verse as one logical paragraph with visual line breaks.

Example · html
<p>
  Roses are red,<br>
  Violets are blue,<br>
  HTML structures the web,<br>
  And CSS styles it too.
</p>

hr as a thematic section divider

<hr> draws a horizontal rule to visually separate two thematic content sections on the page.

Example · html
<section>
  <h2>Chapter 1: Basics</h2>
  <p>We covered HTML fundamentals in this chapter.</p>
</section>
<hr>
<section>
  <h2>Chapter 2: Styling</h2>
  <p>Next we explore CSS.</p>
</section>

Discussion

  • Be the first to comment on this lesson.
Line Breaks and Horizontal Rules — HTML | SoundsCode