HTML <br> 元素在文本中生成一个换行(回车)符号。此元素在写诗和地址时很有用,这些地方的换行都非常重要。

内容分类 Flow content, phrasing content.
允许的内容 无,这是一个空元素.
标签略写 必须有一个开始标签,并且一定不能有结束标签。在 XHTML中将元素写为 <br />
允许的父元素 任意可容纳 phrasing content 的元素。
Permitted ARIA roles 任意
DOM 接口 HTMLBRElement

属性

此元素的属性包括全局属性

clear 已废弃 HTML4.01 已废弃 HTML5
指定换行后下一行文本开始位置。

使用注意: 此属性HTML5 中已被废弃,请勿使用。 请用 clear 属性替代。

注意

不要用 <br> 来增加文本之间的行间隔;应使用 CSS margin 属性或<p> 元素。

例子

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

The HTML above outputs:

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

技术规范

Specification Status Comment
HTML Living Standard
<br>
Living Standard  
HTML5
<br>
Recommendation  
HTML 4.01 Specification
<br>
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.

参见

文档标签和贡献者

此页面的贡献者: kite-js, hoyt, gqqnbig, venden
最后编辑者: kite-js,