HTML <hr>
Tag
Example
Use the <hr>
tag to separate content when the topic changes:
Browser Support
All major browsers support the <hr>
tag.
Tag Definition and Usage
The <hr>
tag defines a thematic break in an HTML page (such as a shift of topic) and is displayed as a horizontal line.
The <hr>
element is used to separate content in an HTML page (or to define a change).
Differences Between HTML 4.01 and HTML5
In HTML5, <hr>
defines a thematic change in the content and is displayed as a horizontal line.
In HTML 4.01, the <hr>
tag is simply displayed as a horizontal line.
In HTML 4.01, all layout attributes are deprecated. These attributes are no longer supported in HTML5. Use CSS to define the style 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 <br>center <br>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 <hr> element should be displayed in a solid color. |
size | pixels | Not supported in HTML5. Deprecated in HTML 4.01. Specifies the height of the <hr> element. |
width | pixels<br> % | Not supported in HTML5. Deprecated in HTML 4.01. Specifies the width of the <hr> element. |
Global Attributes
The <hr>
tag supports HTML's global attributes.
Event Attributes
The <hr>
tag supports HTML's event attributes.