?
This document uses PHP Chinese website manual Release
HTML<hr>
元素表示段落級元素之間的主題轉(zhuǎn)換(例如,一個故事中的場景的改變,或一個章節(jié)的主題的改變)。在HTML的早期版本中,它是一個水平線?,F(xiàn)在它仍能在可視化瀏覽器中表現(xiàn)為水平線,但目前被定義為語義上的,而不是表現(xiàn)層面上。
內(nèi)容類別 | 流量內(nèi)容。 |
---|---|
允許的內(nèi)容 | 沒有,這是一個空的元素。 |
標(biāo)記遺漏 | 它必須有開始標(biāo)記,但不能有結(jié)束標(biāo)記。 |
允許的父母 | 任何接受流內(nèi)容的元素。 |
允許ARIA角色 | 介紹 |
DOM界面 | HTMLHRElement |
該元素包含全局屬性
align
設(shè)置對齊方式. 如果沒有值, 默認(rèn)值為 left。
color
使用顏色名或十六進制設(shè)置顏色。
noshade
去除陰影。
size
使用像素設(shè)置高度。
width
使用像素或者百分比設(shè)置寬度。
<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>
輸出:
這是文本的第一段。這是文本的第一段。這是文本的第一段。這是文本的第一段。
這是文本的第二段。這是文本的第二段。這是文本的第二段。這是文本的第二段。
規(guī)范 | 狀態(tài) | 評論 |
---|---|---|
HTML生活標(biāo)準(zhǔn)該規(guī)范中'<hr>'的定義。 | 生活水平 | hr元素的定義 |
HTML生活標(biāo)準(zhǔn) | 生活水平 | hr元素的建議默認(rèn)渲染 |
HTML5該規(guī)范中'<hr>'的定義。 | 建議 | |
HTML 4.01規(guī)范該規(guī)范中'<hr>'的定義。 | 建議 | align,noshade,size和width屬性已被棄用 |
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic Support | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
align | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
color | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
noshade | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
size | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
width | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
Feature | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic Support | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
align | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
color | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
noshade | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
size | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
width | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |