Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

HTML hr tag and element

HTML horizontal rule

1. HTML hr element is used to represent a horizontal rule.

2. HTML hr element starts with a <hr> tag but end tag forbidden.

Syntax

<hr>

Whether both start and end tags are required

Start tag required, End tag forbidden.

Attributes of hr element

Identifiers

id, class.

language information and text direction

lang, dir.

Title

Title.

Style

Style.

Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup.

Supported doctypes

HTML 4.01 strict, HTML 4.01 transitional, HTML 4.01 frameset.

Example of using HTML hr element

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "https://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>HTML hr tag example - HTML tutorial | w3resource</title>
</head>
<body>
<h2>Following is an HTML hr tag</h2>
<hr>
</body>
</html>

Result

html hr element

View this example in a separate browser window

HTML hr tag example

Previous: HTML param tag and element
Next: HTML frame tag and element

Test your Programming skills with w3resource's quiz.