Computer Programming

Html hr tag and its attributes

Pinterest LinkedIn Tumblr

Welcome to this article here in this article, we will discuss the Html hr tag, and how to use the hr tag in Html. So let’s start with 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 horizontal lines.

The hr tag is actually the unpair tag which 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 the browser window.

There are lots of attributes of HTML and we will discuss all these tags one by one. So let’s start the discussion.


This is an important attribute of the hr tag and it actually uses to define the color of our horizontal rule.


<hr color=”red”/>

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


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


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

This will automatically display 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 used 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

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

Hey there! 👋 I'm Francis MD, a multi-talented medical doctor with an insatiable thirst for knowledge: data analysis, software developent, and other techs. When I'm not saving lives or crunching numbers, you'll find me fueling my passion for sports as a Capoeirista or Animal Flowist. In addition, I have a hidden identity as a self-proclaimed connoisseur of super-hero movies and comics. 🦸‍♂️Whether it's Marvel or DC, you can bet that I've got all the geeky trivia up my sleeve.