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>



Output


Picture showing the output of hr tag in html

Click to Enlarge


Attributes




Attribute NameValueDescription
Alignleft, right and centerSpecifies alignment of horizontal line.
Noshade Removes shading from 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>




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>




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