hr
HTML5 hr element
The hr element allows you to separate paragraphs with different thematics, by adding a horizontal line between them. » video
About hr
- is an optional element
- multiple hr elements allowed per HTML5 document
Display & support hr
- display in browser »video
- display type: block





Parents hr
- hr nested within elements »hr parents
»examples
Attributes hr
- required: none
- optional: global attributes, event attributes
Syntax hr
1 | <> »video |
Attributes and Values bdo (comma separated)
< | attribute | = | "attribute_value(s)" | > | Video | Examples |
---|---|---|---|---|---|---|
1. specific attributes | ||||||
All Specific Attributes | ||||||
2. global attributes | ||||||
1. | accesskey | = | keyboard key | »img | <accesskey="h"> > | |
2. | class | = | class name | »html »img | - | |
3. | contenteditable | = | "", , true, false | »html | - | |
4. | contextmenu | = | menu id value | »html | - | |
5. | data-* | = | value | - | - | |
6. | dir | = | ltr, rtl, auto | »html | - | |
7. | draggable | = | true, , false | »img | <draggable="false"> > | |
8. | dropzone | = | copy, move, link, string:, file: | - | <dropzone="copy"> > | |
9. | hidden | = | "", , hidden | »html »img | <hidden="hidden"> > | |
10. | id | = | id name | »html »img | <id="unique_id_name"> > | |
11. | itemid | = | URL | - | - | |
12. | itemprop | = | string | »link »a | - | |
13. | itemref | = | string | - | - | |
14. | itemscope | = | "", , itemscope | - | - | |
15. | itemtype | = | absolute URL | - | - | |
16. | lang | = | language code | »html »head»title »img | - | |
17. | spellcheck | = | "", , true, false | »html | - | |
18. | style | = | CSS property:value | »html »img | <style="color:red"> > | |
19. | tabindex | = | integer | »img | <tabindex="3"> > | |
20. | title | = | text | »html »link»style »abbr»dfn »img »meter | <title="html page"> > | |
21. | translate | = | "", yes, no | »html »img | - | |
All Global Attributes | ||||||
3. global event attributes | ||||||
1. | onclick | = | script | » list | <element onclick="script" > ... | |
2. | ondblclick | = | script | » list | <element ondblclick="script" > ... | |
All Event Attributes |
Video demonstration hr element
HTML5 hr element: separate paragraphs
min | video details |
---|---|
00:00 | video tutorial: hr element |
00:05 | the hr element allows you to separate paragraphs with different thematics, by adding a horizontal rule (line) between them |
00:12 | the 2 paragraphs inside the article have different thematics: - one presents the physical properties - the other one presents the chemical ones and can be separated through hr element |
00:29 | adding the hr element between the 2 paragraphs (at paragraph-level) |