Encodera

Thanks for reading!

Donate to the site — we work hard for you.

HTML & CSS reference

<hr>

A thematic break between parts of the text; shown as a horizontal line by default.

Syntax

<hr>

Examples

A change of topic inside the text:

<p>Our espresso is made from Brazilian beans.</p>
<hr>
<p>In other news: we now open at 7 am.</p>

The look of the line is set in CSS:

<style>
  hr { border: none; border-top: 2px dashed tomato; margin: 16px 0; }
</style>
 
<p>Part one</p>
<hr>
<p>Part two</p>

Notes

The tag is single. It means a change of topic, not just a line: for a purely decorative line, a border on a neighbouring block is enough.

See also

  • <br> — A line break inside text; `<wbr>` marks where a line may break if space runs out.
  • <p> — A paragraph of text.
  • <section> — A thematic section of the page with its own heading.

In the tutorial

  • Headings and paragraphs — Six levels of headings, paragraphs, spaces and line breaks, the thematic break and quotes in HTML.

Thanks for reading!

Donate to the site — we work hard for you.