HR Tag
This tag provides you the facility of drawing horizontal rulers or lines to separate various parts of your web page. The horizontal line produced with this tag is drawn across the width of the browser window in proportionate size.By default the rule is aligned center.
Size and Width Attributes:-
This tag has two major attributes:Size and Width. The Size attribute specifies the thickness of the ruler line in no. of pixels and the Width attribute specifies the length of the ruler line in percentage of the width of browser window.For Example, if you want to draw a rule of thickness 5 and width 75% of browser window, the you should give the command as follows:
<hr size=5 width=75%>
This tag is an empty element.You can use this tag without attributes to draw a ruler line across the whole, i.e. 100% of the browser window.Default thickness is 3 pixels.The width can also be given in exact number of pixels.The following exercise illustrates the use od size and width attributes of this tag.
Exercise::–
Here we are drawing horizontal rulers of different sizes and widths. The output of this document is shown in Exercise.
<html>
<head>
<title> Drawing Horizontal Rules </title>
</head>
<body>
The following is a rule of default size and width .<hr>
The following rule is of thickness 8 pixels and width 50%.
<hr size=8 width=50%>
The following rule is of thickness 8 pixels and width 75%.
<hr size=12 width=75%>
The following rule is of thickness 8 pixels and full length.
<hr size=20>
</body>
</html>