HTML <hr>Tag
Examples
When the theme of the content changes, use the <hr> tag to separate:
<p>HTML is a language used to describe web pages.</p>
<hr>
<h1>CSS</h1>
<p>CSS defines how HTML elements are displayed.</p>
Try it Yourself »
Browser Support
![]()
All major browsers support the <hr> tag.
Tag Definition and Usage Instructions
The <hr> tag defines a thematic change in an HTML page (such as a shift of topic) and displays it as a horizontal line.
The <hr> element is used to separate content in an HTML page (or define a change).
Differences Between HTML 4.01 and HTML5
In HTML5, the <hr> defines a thematic change in content and displays it as a horizontal line.
In HTML 4.01, the <hr> tag merely displays as a horizontal line.
In HTML 4.01, all layout attributes aredeprecated. In HTML5, these attributes are no longer supported. Please use CSS to define styles for the <hr> element.
Differences Between HTML and XHTML
In HTML, the <hr> tag has no closing tag.
In XHTML, the <hr> tag must be properly closed, such as <hr />.
Attributes
| Attribute | Value | Description |
|---|---|---|
| align | left center right |
Not supported in HTML5. Deprecated in HTML 4.01.Specifies the alignment of the <hr> element |
| noshade | noshade | Not supported in HTML5. Deprecated in HTML 4.01.Specifies that the color of the <hr> element be rendered as a solid color. |
| size | pixels | Not supported in HTML5. Deprecated in HTML 4.01.Specifies the height of the <hr> element. |
| width | pixels % |
Not supported in HTML5. Deprecated in HTML 4.01.Specifies the width of the <hr> element. |
Global Attributes
The <hr> tag supportsthe HTML Global Attributes。
Event Attributes
The <hr> tag supportsthe HTML Event Attributes。
Other Extensions