The <hr>
represents a thematic break between paragraph-level elements: for example, a change of scene in a story, or a shift of topic within a section.
Historically, this has been presented as a horizontal rule or line. While it may still be displayed as a horizontal rule in visual browsers, this element is now defined in semantic terms, rather than presentational terms, so if you wish to draw a horizontal line, you should do so using appropriate CSS.
Content categories | Flow content. |
---|---|
Permitted content | None, it is an empty element. |
Tag omission | It must have start tag, but must not have an end tag. |
Permitted parents | Any element that accepts flow content. |
Implicit ARIA role | separator |
Permitted ARIA roles |
presentation or none
|
DOM interface | HTMLHRElement |
This element's attributes include the global attributes.
align
left
.color
noshade
size
width
<p> This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text. </p> <hr> <p> This is the second paragraph of text. This is the second paragraph of text. This is the second paragraph of text. This is the second paragraph of text. </p>
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of '<hr>' in that specification. | Living Standard | Definition of the <hr> element |
HTML5 The definition of '<hr>' in that specification. | Recommendation | |
HTML 4.01 Specification The definition of '<hr>' in that specification. | Recommendation | The align , noshade , size , and width attributes are deprecated |
Desktop | ||||||
---|---|---|---|---|---|---|
hr |
Yes | 12 | 1 | Yes | Yes | Yes |
align
|
Yes | 12 | 1 | Yes | Yes | Yes |
color
|
Yes | 12 | 1 | Yes | Yes | Yes |
noshade
|
Yes | 12 | 1 | Yes | Yes | Yes |
size
|
Yes | 12 | 1 | Yes | Yes | Yes |
width
|
Yes | 12 | 1 | Yes | Yes | Yes |
Mobile | ||||||
---|---|---|---|---|---|---|
hr |
Yes | Yes | 4 | Yes | Yes | Yes |
align
|
Yes | Yes | 4 | Yes | Yes | Yes |
color
|
Yes | Yes | 4 | Yes | Yes | Yes |
noshade
|
Yes | Yes | 4 | Yes | Yes | Yes |
size
|
Yes | Yes | 4 | Yes | Yes | Yes |
width
|
Yes | Yes | 4 | Yes | Yes | Yes |
© 2005–2020 Mozilla and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr