×
FREE ASSISTANCE FOR THE INQUISITIVE PEOPLE
Tutorial Topics
X
softetechnologies
Paragraph and Line Break Elements: Text Formatting
Elements: Horizontal Line - HTML 5
7529    Arnab De    04/05/2017   

Introduction

<hr> tag is use for the place a horizontal line on the page.

Width of Horizontal Line

By default the width of the line is 100%. But we can set the width of the line by using width attribute of the <hr> tag.

Full Width Line


Width is 50%


softetechnologies

Alignment of the Horizontal Line

By default the alignment of the line is center. But we can set or alter the alignment of the line by using align attribute of the <hr> tag. This attribute only act when the value of width attribute changed.

Center align line


Alignment set to left.


Color of the Horizontal Line

By default the colour of the line is gray. But we can change it by the color attribute.

Alignment set to left.


softetechnologies

Complete Example

Full Width Line
<hr>

Width is 50% default alignment is center.
<hr width="50%" />

 

Width is 50%. Set the alignment is left.
<hr align="left" width="50%" />

 

Red Color Line
<hr width="50%" />

 

 

HR Tag
HR Tag
Paragraph and Line Break Elements: Text Formatting
softetechnologies
Author Details
Arnab De
I have over 16 years of experience working as an IT professional, ranging from teaching at my own institute to being a computer faculty at different leading institute across Kolkata. I also work as a web developer and designer, having worked for renowned companies and brand. Through tutorialathome, I wish to share my years of knowledge with the readers.
Enter New Comment
Comment History
No Comment Found Yet.
Sri Sri Ramakrishna Paramahamsa
If you want to go east, don't go west.
Sri Sri Ramakrishna Paramahamsa
462
23.83
Today So Far
Total View (Lakh)
softetechnologies
01/01/2018     30778
28/06/2017     25550
02/08/2017     22003
26/05/2018     19717
15/05/2017     19354
06/07/2017     17901
21/04/2018     16863
01/08/2017     16539
01/07/2017     14551
25/04/2018     13617
softetechnologies