HTML Horizontal line

The hr Tag

The HTML <hr> tag is used to specify horizontal line break in HTML document. It draws a horizontal line between different content .


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> HTML hr Tag </title>
</head>
<body>
<h2> HTML </h2>
<p> HTML is a language for describing web pages. </p>
<hr>
<h2> HR Tag </h2>
<p> HR tag is used to draw a horizontal line. <p>
</body>
</html>

Output

HTML hr Tag Examples

HTML

HTML is a language for describing web pages.


HR Tag

HR tag is used to draw a horizontal line.


HR tag in HTML and XHTML

HTML <hr> tag need not to be closed whereas it must be properly closed in XHTML like <hr/>.

HR tag in HTML 4.01 and HTML5 ?

HTML 4.01, the <hr> tag represents a horizontal rule while in HTML 5, it represents a thematic break. CSS is used in HTML5 instead of layout attributes.


Browser Support

Element
Microsoft Edge browser.png Edge
Chrome browser.png Chrome
Firefox browser.png Firefox
Opera browser.png Opera
safari browser.png Safari
<hr>
Yes
Yes
Yes
Yes
Yes








Become a Patron!

Note: If the updated content is not visible to you please refresh the cookies by pressing CTRL + Shift + R.