Spec-Zone.ru › HTML

<hr> HTML thematic break (horizontal rule) element

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

  • Learn more
  • See full compatibility
  • Report feedback
>

The <hr> HTML element represents a thematic break between paragraph-level elements: for example, a change of scene in a story, or a shift of topic within a section.

Try it

<p>§1: The first rule of Fight Club is: You do not talk about Fight Club.</p>

<hr />

<p>§2: The second rule of Fight Club is: Always bring cupcakes.</p>
hr {
  border: none;
  border-top: 3px double #333333;
  color: #333333;
  overflow: visible;
  text-align: center;
  height: 5px;
}

hr::after {
  background: white;
  content: "§";
  padding: 0 4px;
  position: relative;
  top: -13px;
}

Historically, the <hr> element has always been presented as a horizontal rule or line. While it may still be displayed as a horizontal rule in visual browsers, this element is now defined in semantic terms, rather than presentational terms. Therefore, if you wish to draw a horizontal line, you should do so by adding a border to an existing element using CSS.

The border-* properties (for example, border-style and border-color) allow you to significantly customize a line's appearance, whether you are customizing an <hr> element or a border drawn on a different element.

Attributes

This element's attributes include the global attributes.

align

Sets the alignment of the rule on the page. If no value is specified, the default value is left.

color

Sets the color of the rule through color name or hexadecimal value.

noshade

Sets the rule to have no shading.

size

Sets the height, in pixels, of the rule.

width

Sets the length of the rule on the page through a pixel or percentage value.

Example

>

HTML

<p>
  This is the first paragraph of text. This is the first paragraph of text. This
  is the first paragraph of text. This is the first paragraph of text.
</p>

<hr />

<p>
  This is the second paragraph of text. This is the second paragraph of text.
  This is the second paragraph of text. This is the second paragraph of text.
</p>

Result

Technical summary

Content categories Flow content.
Permitted content None; it is a void element.
Tag omission Must have a start tag and must not have an end tag.
Permitted parents
  • Any element that accepts flow content
  • <select> element
Implicit ARIA role separator
Permitted ARIA roles presentation or none
DOM interface HTMLHRElement

Specifications

Specification
HTML>
# the-hr-element>

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
hr 1 12 1 ≤12.1 3 18 4 ≤12.1 1 1.0 4.4 1
align 1 12 1 ≤12.1 ≤4 18 4 ≤12.1 ≤3.2 1.0 4.4 ≤3.2
color 33 12 1 20 10.1 33 4 20 10.3 2.0 4.4.3 10.3
hr_in_select
119["Exposes the <hr> visually in the page only when the menu is expanded (arrowing within the collapsed menu does not show them).", "Does not expose the <hr> in the accessibility tree."]
119["Exposes the <hr> visually in the page only when the menu is expanded (arrowing within the collapsed menu does not show them).", "Does not expose the <hr> in the accessibility tree."]
122Does not expose the <hr> in the accessibility tree.
105["Exposes the <hr> visually in the page only when the menu is expanded (arrowing within the collapsed menu does not show them).", "Does not expose the <hr> in the accessibility tree."]
17Does not expose the <hr> in the accessibility tree.
No 145 No
17.4Does not expose the <hr> in the accessibility tree.
No No
17.4Does not expose the <hr> in the accessibility tree.
noshade 1 12 1 ≤12.1 ≤4 18 4 ≤12.1 ≤3.2 1.0 4.4 ≤3.2
size 1 12 1 ≤12.1 ≤4 18 4 ≤12.1 ≤3.2 1.0 4.4 ≤3.2
width 1 12 1 ≤12.1 ≤4 18 4 ≤12.1 ≤3.2 1.0 4.4 ≤3.2

See also

  • <p>
  • <hr> in <select>

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/hr

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API