English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML: <hr> tag

The HTML <hr> tag defines HTML5The separator between paragraphs, as well as HTML 4.01The horizontal rule. This tag is also commonly referred to as the <hr> element.

Online Example

Use the <hr> tag to separate when the theme of the content changes:

!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML5 The use of <hr> tags (Basic Tutorial Website oldtoolbag.com)</title>
</head>
<body>
<body>
<h1>Heading 1</h1>
<p>This is the first paragraph.</p>
<hr>
<p>This is the second paragraph.</p>
</body>
</html>
Test and see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support the <hr> tag.

Definition and usage instructions of tags

The <hr> tag defines a theme change in an HTML page (such as a topic shift) and is displayed as a horizontal line.

The <hr> element is used to separate content in an HTML page (or define a change).

The <hr> tag is in HTML5The separation between paragraphs.

HTML 4.01 and HTML5Differences between

In HTML5 The <hr> defines a change in the theme within the content and is displayed as a horizontal line.

In HTML 4.01 The <hr> tag is displayed as a horizontal line only.

In HTML 4.01 All layout attributes have been deprecated. In HTML5 No longer supports these attributes. Use CSS to define styles for the <hr> element.

Differences between HTML and XHTML

In HTML, the <hr> tag does not have a closing tag.

In XHTML, the <hr> tag must be properly closed, such as <hr />.

Attribute

AttributeValueDescription
alignleft
center
 right
HTML5 Not supported. HTML 4.01 Deprecated.    Specify the alignment of the <hr> element
noshadenoshadeHTML5 Not supported. HTML 4.01 Deprecated.    Specify the color presentation of the <hr> element as a solid color.
sizepixelsHTML5 Not supported. HTML 4.01 Deprecated.    Specify the height of the <hr> element.
widthpixels
 %
HTML5 Not supported. HTML 4.01 Deprecated.    Specify the width of the <hr> element.

Global attributes

Support for <hr> tag Global attributes of HTML.

Event attributes

Support for <hr> tag HTML event attributes.