Open In App

HTML hr Tag

Last Updated : 11 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The <hr> tag in HTML is used to create a horizontal rule or line that visually separates content.

Syntax:

Some Content.. <hr> Some Content..
HTML
<!DOCTYPE html>

<html>

<body>
    <p>
        There is a horizontal rule 
          below this paragraph.
    </p>
    <hr>
    <p>
        This is a horizontal rule 
          above this paragraph.
    </p>
</body>

</html>

Attributes

The table below shows a few attributes that allow customization:

Attribute ValuesValueDescription
alignleft center rightUsed to specify the alignment of the horizontal rule.
noshadenoshadeUsed to specify the bar without shading effect.
sizepixelsUsed to specify the height of the horizontal rule.
widthpixelsUsed to specify the width of the horizontal rule.

Lets see how different hr tag attributes works together in example below:

HTML
<!DOCTYPE html>
<html>

<body>
    <p>
        Normal horizontal line.
    </p>
    <hr>
    <p>
        Horizontal line with height
        of 30 pixels
    </p>
    <hr size="30">
    <p>
        Horizontal line with height
        of 30 pixels and noshade.
    </p>
    <hr size="30" noshade>
</body>

</html>

Output:

output

HTML <hr> Tag

Similar Reads