Code Example For HTML Hr Tags (And Which Browsers Support Them)

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
Element of
Learn How Fonts And Web Typography Work In HTML: A Beginner's Guide
What does Code Example For HTML Hr Tags (And Which Browsers Support Them) do?
The <hr> element is used to represent a thematic break between paragraph-level elements. It is typically rendered as a horizontal line.
Display
block

Code Example

<p>This is above line.</p>
<hr>
<p>This is below the line.</p>

This is above line.


This is below the line.

A separator, not a border

It is very easy to misuse the <hr> element. If you find yourself including in a page template, you should probably rethink things. Structural sections of your page design should be defined with the appropriate semantic document tags, and any lines you might desire should be defined with CSS. The <hr> element, which creates a small separator bar is best thought of as a typographical element, as something that might come within the context of your content — not a part of the design. This can be useful for when you want to divide a piece of content into sections without using headlines elements.

Adam is a technical writer who specializes in developer documentation and tutorials.

Browser Support for hr

iefirefoxchromeedgesafariopera
AllAllAllAllAllAll