Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. HTML
  3. Reference
  4. Elements
  5. <hr>

<hr>: The 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.

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.

Theborder-* properties (for example,border-style andborder-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 theglobal attributes.

alignDeprecatedNon-standard

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

colorDeprecatedNon-standard

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

noshadeDeprecatedNon-standard

Sets the rule to have no shading.

sizeDeprecatedNon-standard

Sets the height, in pixels, of the rule.

widthDeprecatedNon-standard

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

Example

HTML

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 categoriesFlow content.
Permitted contentNone; it is avoid element.
Tag omissionMust have a start tag and must not have an end tag.
Permitted parents
Implicit ARIA roleseparator
Permitted ARIA rolespresentation ornone
DOM interfaceHTMLHRElement

Specifications

Specification
HTML
# the-hr-element

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp