HTML <hr> tag

Updated: 09/12/2023 by Computer Hope
HTML hr tag

When writing in HTML (hypertext markup language), the <hr> tag is a block element used to denote a thematic break (horizontal line) on a web page. It is useful when you are changing a topic or want to separate content on a page. The following sections contain information about this tag, including an example of it in use, and related attributes and browser compatibility.

Example of <hr> code

<h3 class="ce">Here is a heading about one subject</h3>
<hr>
<p class="ce">Here is a paragraph about a different subject.</p>

Example result

Here is a heading about one subject


Here is a paragraph about a different subject.

Deprecated attributes

All HTML tags support standard attributes that define the settings of an HTML element. In addition to the standard settings, the <hr> tag had the following unique attributes that are now deprecated.

Attribute Description
align Designates the alignment of the <hr> element.
noshade Designates that the <hr> element should be one solid color.
size Designates the height of the element.
width Designates the width of the element.

Compatibility

Edge Internet Explorer Firefox Safari Opera Chrome
All versions All versions All versions All version All versions All versions

Browser, Class, Compatibility, Web design terms