<hr>

The HTML <hr> element generates a horizontal line or thematic break within a document, visually dividing content sections and signaling a change in topic or narrative.

hr Tag

The <hr> element represents a thematic division in content, often signaling a shift in topic or a section break.

Syntax

index.html
<hr>

hr Demo

Main Heading

This is some introductory content.


Section Heading

This is content for the new section.

index.html
<h1>Main Heading</h1>
<p>This is some introductory content.</p>
<hr>
<h2>Section Heading</h2>
<p>This is content for the new section.</p>
The <hr> tag creates a horizontal line to visually separate sections within a document.

Attributes

This element supports global attributes.

align

Specifies the horizontal alignment of the rule. The default alignment is left.

color

Defines the rule's color using a color name or hexadecimal value.

noshade

Displays the rule without shading.

size

Sets the rule's height in pixels.

width

Specifies the rule's width in pixels or as a percentage.

Conclusion

The <hr> tag is useful for visually dividing content and indicating thematic breaks. While it offers attributes for customization, modern web design favors CSS for greater styling flexibility. Using <hr> helps structure content effectively, improving readability and presentation.