<hr>: The Thematic Break (Horizontal Rule) element
<hr>
HTML 元素表示段落级元素之间的主题分隔:例如,故事中场景的变化,或者章节中主题的转变。
¥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
从历史上看,这被表现为水平的规则或线。虽然它仍然可能在可视浏览器中显示为水平线,但该元素现在是用语义术语而不是表示术语定义的,因此如果你希望绘制水平线,则应该使用适当的 CSS 来实现。
¥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.
属性
¥Attributes
该元素的属性包括 全局属性。
¥This element's attributes include the global attributes.
示例
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>
结果
技术总结
¥Technical summary
内容类别 | 流量内容. |
---|---|
允许的内容 | 没有任何;这是 void element。 |
标签遗漏 | 必须有开始标记,并且不能有结束标记。 |
允许的父级 | |
隐式 ARIA 角色 | separator |
允许的 ARIA 角色 | presentation 或 none |
DOM 接口 | HTMLHRElement |
规范
Specification |
---|
HTML Standard # the-hr-element |
浏览器兼容性
BCD tables only load in the browser
也可以看看
¥See also