HTML <br> 元素會產生文字的斷行(carriage-return、CR 或是確認鍵)。此元素主要用於寫詩或寫住址,這種斷行有所意義的時候。

內容類型 流型內容段落型內容
允許內容 無,這是個空元素.
標籤省略 絕對要有開啟標籤,也絕不能關閉標籤。在 XHTML 文件內,要把這個元素寫成 <br />.
允許父元素 任何接受段落型內容的元素
允許的 ARIA roles 所有
DOM 介面 HTMLBRElement

屬性

這個元件屬性含有全域屬性

clear 已正式宣告棄用 HTML4.01 已過時 HTML5
指示中斷後下一行的開始位置。

注:這個屬性在 HTML5 棄用,因此不應該使用。請使用 CSS clear 屬性。

註解

不要使用 <br> 來增加文字間距,你應該用 CSSmargin 屬性、或改用 <p> 元素以完成這件事。

示例

Mozilla Foundation<br>
1981 Landings Drive<br>
Building K<br>
Mountain View, CA 94043-0801<br>
USA

以上 HTML 將顯示

Mozilla Foundation
1981 Landings Drive
Building K
Mountain View, CA 94043-0801
USA

規範

規範 狀態 註解
HTML Living Standard
The definition of '<br>' in that specification.
Living Standard
HTML5
The definition of '<br>' in that specification.
Recommendation
HTML 4.01 Specification
The definition of '<br>' in that specification.
Recommendation

瀏覽器相容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
clear
Deprecated
Chrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.

參見

文件標籤與貢獻者

此頁面的貢獻者: iigmir
最近更新: iigmir,