<hr>
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.
HTML 的** <hr>
元素**代表在段落層級的焦點轉換(如故事中的場景轉換或某個小節裡的主題移轉)。在之前的 HTML 版本,它代表著一條水平標線。在視覺瀏覽器裡,它現在可能還是以水平標線的型式呈現;但它已經被重新定義為一個語義上的用詞,而不是呈現上的。
內容類型 | 流內容. |
---|---|
Permitted content | 否。這是個 empty element. |
標籤省略 | 一定要有起始標籤、同時絕不能有結束標籤 |
Permitted parent elements | 任何允許流內容的元素。 |
DOM interface | HTMLHRElement |
屬性
範例
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 second paragraph of text. This is second paragraph of text. This is
second paragraph of text. This is second paragraph of text.
</p>
上面的 HTML 會輸出:
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.
This is second paragraph of text. This is second paragraph of text. This is second paragraph of text. This is second paragraph of text.
規範
Specification |
---|
HTML Standard # the-hr-element |
瀏覽器相容性
BCD tables only load in the browser