Text Formatting

HTML <hr> Tag

The <hr> tag defines a thematic break in an HTML page (e.g. a shift of topic).

Definition and Usage

The <hr> tag defines a thematic break in an HTML page (e.g. a shift of topic).

Standard Syntax:<hr>

Interactive ExampleRunnable

HTML <hr> Example

html
Try it Yourself
Live code demonstration for the <hr> tag. Click "Try it Yourself" to edit and experiment in real time.
<div style="font-family: system-ui, sans-serif; padding: 16px; background: #ffffff; border-radius: 8px; border: 1px solid #e2e8f0; color: #0f172a;">
<h1>The Main Languages of the Web</h1>

<p>HTML is the standard markup 
    language for creating Web pages. HTML describes the structure of a Web page, 
    and consists of a series of elements. HTML elements tell the browser how to 
    display the content.</p>

<hr>

<p>CSS is a language that 
    describes how HTML elements are to be displayed on screen, paper, or in 
    other media. CSS saves a lot of work, because it can control the layout of 
    multiple web pages all at once.</p>

<hr>

<p>JavaScript is the 
    programming language of HTML and the Web. JavaScript can change HTML content 
    and attribute values. JavaScript can change CSS. JavaScript can hide and 
    show HTML elements, and more.</p>
</div>

Attributes for <hr>

0 Supported Attributes

The <hr> tag does not have tag-specific attributes. It supports all standard Global Attributes.

Global Attributes

The <hr> tag also supports the standard global attributes in HTML, including class, id, style, title, hidden, and data-*.

HTML Global Attributes Reference →
Event Attributes

The <hr> tag supports event attributes in HTML, such as onclick, onmouseover, onfocus, and more.

HTML Event Attributes Reference →

Browser Compatibility

ChromeEdgeFirefoxSafariOpera

More Tags in Text Formatting

View All 123Tags →