HTML <hr>
элемент служит для тематического разделения абзацев.Рисует горизонтальную прямую
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Historically, this has 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, so if you wish to draw a horizontal line, you should do so using appropriate CSS.
Content categories | Flow content. |
---|---|
Permitted content | None, it is an empty element. |
Tag omission | It must have start tag, but must not have an end tag. |
Permitted parents | Any element that accepts flow content. |
Implicit ARIA role | separator |
Permitted ARIA roles | presentation or none |
DOM interface | HTMLHRElement |
Attributes
This element's attributes include the global attributes.
align
- Задает правило выравнивания.По умолчанию значение выставленно как left
color
- Задает цвет линии
noshade
- Sets the rule to have no shading.
size
- Устанавливает высоту в px
width
- Задает длину линии в px либо в %
Example
HTML
<p>
Это первый параграф текста
Это первый параграф текста
Это первый параграф текста
Это первый параграф текста
</p>
<hr>
<p>
Это второй параграф текста
Это второй параграф текста
Это второй параграф текста
Это второй параграф текста
</p>
Result
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard Определение '<hr>' в этой спецификации. |
Живой стандарт | Definition of the <hr> element |
HTML5 Определение '<hr>' в этой спецификации. |
Рекомендация | |
HTML 4.01 Specification Определение '<hr>' в этой спецификации. |
Рекомендация | The align , noshade , size , and width attributes are deprecated |
Browser compatibility
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.