<hr> tag

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>

Example

<h1>WORK</h1>
<hr>
<h1>PASSION</h1>

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).

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

supporting-browsers for tags

Related Tags

<hr> tag.

Tutorials for all brains!