HTML <hr> tag
The <hr>(horizontal rule) tag inserts a horizontal line between paragraph level documents.
This is a way to show a thematic break between paragraph level elements to show the topic change.
Syntax:
<hr>
How Browser will display
BLOCK Level.
Difference between HTML4.01, XHTML and HTML5
HTML4 | XHTML | HTML5 |
---|---|---|
<hr> tag does not have end tag | There is an end tag. You should code like <hr /> | All the attributes of the <hr> tag are removed in HTML5 |
Attributes used with <hr> tag
align | To align the hr tag to left, right or center. (HTML5 does not support this attribute when it is used with the <hr> tag). |
noshade | To inform that there should not be a shade for the horizontal line. The horizontal line must be a solid line.. (HTML5 does not support this attribute when it is used with the <hr> tag). |
size | To set the height of the horizontal line in pixels. (HTML5 does not support this attribute when it is used with the <hr> tag). |
width | To set the width of the horizontal line in pixels or %. (HTML5 does not support this attribute when it is used with the <hr> tag). |
Note/Warning/Danger/Info Do not use the above listed attributes of the <hr> tag as they are obsolete(redundant) in HTML5. Instead, it is better to use CSS properties.
Global Attributes
The <hr> tag supports Global attributes.
Event Attributes
The <hr> tag supports Event attributes.
Default CSS Values
display: block;
margin-top: 0.5em;
margin-bottom: 0.5em;
margin-left: auto;
margin-right: auto;
border-style: inset;
border-width: 1px;
Supporting Browsers
Related Tags
<hr> tag.