Start your markdown portfolio blog with nextjs, nextra, tailwind CSS, and Shadcn UI using the section blog theme.
Rajdeep Singh.

hr tag In HTML5

hr tag Define Horizontal Rule in the web page.

By html 1 min read

The HTML <hr> element represents a horizontal Rule or a Create a Page break Between Tow Element on html page.

The <hr> tag is an empty tag and it does not require an end tag.

Syntax

<hr>

Attribute Value Description


Example 1

<html> 
    <head> 
        <title>HTML hr tag</title> 
    </head> 
    <body> 
        <p>horizontal First Element after this  paragraph.</p> 
        <hr> 
        <p>horizontal Second Element before End here</p> 
	<hr>
  	<p>horizontal Three Element before End here</p> 
    </body> 
</html>

Example 2

<html> 
    <head> 
        <title>HTML hr tag with attributes</title> 
    </head> 
    <body> 
        <p>horizontal First Normal Element</p> 
        <hr>     
        <p>horizontal Second Element with height of 20 pixels</p> 
        <hr size="20"> 
           
        <p>horizontal Third Element with height of 30 pixels and noshade.</p> 
        <hr size="20" noshade> 
    </body> 
</html>

Example 3

<html> 
    <head> 
        <title>HTML hr Style</title> 
    </head> 
    <body> 
        <p>horizontal First Normal Element</p> 
        <hr style="height:30px">     
       
	<p>horizontal Second Element With Style</p> 
        <hr style="height:30%"> 
           
        <p>horizontal third Element With Style</p> 
        <hr style="width:300px"> 
    </body> 
</html>