The <hr> (or horizontal rule) element represents a semantic line break between text elements (e.g., a topic-change within a section).

Note: While the <hr> element was originally created for visual purposes, it is now used for semantic distinction. Styling with CSS is now recommended for creating a horizontal line for presentational purposes.


<hr />

The <hr> element is self-closing and the forward slash / is optional. This should be used to semantically separate other elements (e.g., a topic-change within a section).


In the following example, the <hr> element provides a semantic break between the text of two <p> elements:

<p>This is a paragraph.</p>
<hr />
<p>This is a different paragraph.</p>


Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn HTML on Codecademy