HTML Horizontal Line HR Tag
Horizontal lines are used to separate different areas of a web page. It is used to display a horizontal line in the page. The tag for horizontal line is <HR>. This tag has no closing tag.Attributes
Some important attributes of HR tag are as follows:ALIGN
It specifies the alignment of the line. Possible values are left, right and center. Line appears in center by default.SIZE
It specifies the size of the line. The default size is 2 pixelsWIDTH
It specifies the width of line. Size can be given in pixels or percentage The width of line is according to the width of webpage by default.NOSHADE
It turns off the shading of the line.COLOR
It specifies the color of the lineExample
«HR WIDTH=50 ALIGN="center", SIZE=4>«HR WIDTH=50% SIZE=7 NOSHADE>
Now take a look how to do it practically.
Practical
Open Notepad and type the following code:
<HTML>
<BODY>
<HR WIDTH=50 ALIGN="right" SIZE=4 COLOR="red">
<HR WIDTH=50% ALIGN="center" SIZE=7 COLOR="brown">
<HR WIDTH=100% SIZE=15 COLOR="blue">
</BODY
</HTML>
2. Save the file as "line.html"
3. Double click the file. The web page will appear in the browser as follows: