<hr>
HTML 的 <hr>
元素代表在段落層級的焦點轉換(如故事中的場景轉換或某個小節裡的主題移轉)。在之前的 HTML 版本,它代表著一條水平標線。在視覺瀏覽器裡,它現在可能還是以水平標線的型式呈現;但它已經被重新定義為一個語義上的用詞,而不是呈現上的。
內容類型 (en-US) | 流內容 (en-US). |
---|---|
Permitted content | 否。這是個 empty element. |
標籤省略 | 一定要有起始標籤、同時絕不能有結束標籤 |
Permitted parent elements | 任何允許流內容 (en-US)的元素。 |
DOM interface | HTMLHRElement (en-US) |
屬性
範例
<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.
<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.
上面的 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 | Status | Comment |
---|---|---|
HTML Living Standard The definition of '<hr>' in that specification. |
Living Standard | Definition of the hr element |
HTML Living Standard | Living Standard | Suggested default rendering of the hr element |
HTML5 The definition of '<hr>' in that specification. |
Recommendation | |
HTML 4.01 Specification The definition of '<hr>' in that specification. |
Recommendation | The align , noshade , size and width attributes are deprecated |
瀏覽器相容性
BCD tables only load in the browser