Html hr tag

Html hr tag and its attributes

Welcome to this article and here in this article, we will discuss the Html hr tag, and how to use the hr tag in Html. So let’s starts the topic.

What is the hr tag in Html?

The hr tag actually stands for the horizontal ruler in our html tag.

And it actually use to draw the horizontal lines.

The hr tag is actually the unpair tag that means there is only one tag that will contain both the tag opening tag as well as closing tag. There is no separate opening hr or closing hr tag.

Hr tag is also a kind of block level tag and it takes the entire width of its parent of browser window.

There are lots of attributes of html and we will discuss about all these tags one by one. So lets starts the discussion.


This is an immportant attribute of the hr tag and it actually use to define the color of out horizontal rule.


<hr color=”red”/>

We can also give the hr color in the hexadecimal values.


This actually use to define the width of our hr rule.


<hr color=”green” width=”100”>

This will automatically displays the hr width in 100 pixels. And we can define the hr width with the percentage also.


The size actually indicates the Html hr thickness. This value also measures pixels also. And the percentage won’t work for the thickness of the hr line.


<hr color=”blue” width=”20%” size=”5”/>

Align :

This attribute use to set the alignment of our hr line text. We can define the hr alignment in three areas in the left side, the right side, or the center position.

And by default it is actually set in the left position.


<hr color=”blue” width=”20%” size=”10” align=”right”/>

Example of hr tag in Html:

Html hr tag

and here is the output

Html hr tag


This article is all about the Html hr tag and here I explain how to use this within Html, I hope you like this article and if you have any kind of query then please ask me at [email protected].

Ans please follow our website for this kind of informational article.

Also read

How to use the iframe tag in Html
Difference between section vs div tag in Html
The basic structure of Html