The <hr> Tag in HTML

In HTML the hr tag means horizontal rule. It is used to divide a web page into sections or to insert horizontal lines. It is an empty tag, so it does not require an end tag.


How To Use hr tag in HTML ?


How To Use <hr> Tag ?

To know how to use hr tag in HTML, you can see the following example:

<!DOCTYPE html>
<html>
<head>
<title>How To use hr tag in HTML ?</title>
</head>
<body>
<p>This is an example paragraph.</p>
<hr>
<p>This is an example paragraph.</p>
</body>
</html> code-box
     

The <hr> Tag Attributes

The hr tag takes some attributes as follows:

Align : 

Value : Left, Center, Right
Description : This attribute is used to align the horizontal rule.

Noshade : 

Value : noshade
Description : The shadow is removed from the horizontal rule using this attribute.

Size : 

Value : pixels like 30px
Description : With this help, the height of horizontal rule can be increased or decreased.

Width :

Value : pixels like 30px
Description : With this help, the width of horizontal rule can be increased or decreased.

<!DOCTYPE html>
<html>
<head>
<title>How To use hr tag in HTML ?</title>
</head>
<body>
<p>Align hr Tag</p>
<hr align="center">
<p>Noshade effect on hr Tag</p>
<hr noshade>
<p>Apply hr tag size</p>
<hr size="30">
<p>Apply width on hr Tag (By default align center)</p>
<hr width="30" align="left"></body>
</html> code-box

Summary

In this post we learn how to use hr tag in HTML. You try to make it yourself. I hope you make. If you face any problem, then comment and tell us. Keep visiting the blog to read more similar posts.

Post a Comment

Previous Post Next Post