Articles → HTML → Hr Tag In HTML

Hr Tag In HTML






Purpose





Syntax


<hr />



Example


<html>
<head>
    <title>hr demo</title>
</head>
<body>
    <hr />
</body>
</html>

Try It


Output


Picture showing the output of hr tag in html
Click to Enlarge


Attributes




Attribute NameValueDescription
Alignleft, right and centerSpecifies the alignment of the horizontal line
Noshade Removes shading from the horizontal line
SizePixels or %Specifies the height of the horizontal line.
WidthPixels or %Specifies the width of the horizontal line.




<html>
<head>
    <title>hr demo</title>
</head>
<body>    
    <hr noshade />
</body>
</html>

Try It



Picture showing the output of hr tag in html with noshade attribute
Click to Enlarge



<html>
<head>
    <title>hr demo</title>
</head>
<body>
    <hr size="10" width="200" align="center" />
</body>
</html>

Try It



Picture showing the output of hr tag in html with height,width and align attibute
Click to Enlarge


Browser Support


Internet ExplorerFirefoxChromeSafariOperaEdge
YesYesYesYesYesYes



Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, October 5, 2016
 
Updated On  -  Saturday, September 16, 2017

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250