The HR Tag in HTML, Free online HTML Tutorial, Learn HTML online for free...
|Lessons||The HR Tag|
By simply writing <hr> places a horizontal line like one below:
But what if you need to control the color and size of this line? Don't worry the HR tag also comes with a variety of different attributes that give you control over this tag.
By using this attribute the horizontal rule can be aligned to the left or right of the page. It can take the value of center, left or right. The default alignment is center. The alignment effect can only be noticed if the width of the HR is less than the page width.
<hr width="150" align="left">
<hr width="150" align="center">
<hr width="150" align="right">
By using this attribut the vertical size of the HR can be controlled. It can take a whole number as its value. The default size is 2.
<hr width="150" align="right" size="10">
You have complete control over the color of the HR. By using the color attribute of the HR tag, you can make the HR appear in any supporting color. A complete list of html colors can be found here. <hr color="pink">
If you don't like the default shaded appearance of the HR, the noshade attribute, without any value, can be used. This will make the HR appear as a solid color.
<hr size="15" noshade>
Next >>> Lesson No. 14: Adding Comments in HTML