November 15, 2026
What is the HTML tag used to create a horizontal rule (horizontal line) on a webpage?
The <hr> tag creates a horizontal line in your webpage. The <hr> tag is a self-contained HTML element that does not require a separate closing tag.
Example
<html>
<head>
</head>
<body>
<hr>
</body>
</html>
Output
There are some attributes available of <hr> tag which enhance their design and appearance. Attributes are defined below:
| Align |
You can set alignment of line. There values available left, center and right. If you do not specify align attribute then default alignment remain left.
Align="left"
Align="center"
Align="right"
|
| Size |
It specifies the size of the line. |
| Width |
It specifies the width of the line. |
FAQ
1. Is the <hr> tag an empty element in HTML?
Yes, the <hr> tag is an empty HTML element because it does not contain any content or require a separate closing tag. You can write it simply as <hr> in an HTML document.
2. How do you insert a horizontal line in an HTML webpage?
You can insert a horizontal line by placing the <hr> tag wherever you want to create a thematic break in your webpage.