From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/html/element/br/index.html | 113 +++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 files/zh-cn/web/html/element/br/index.html (limited to 'files/zh-cn/web/html/element/br') diff --git a/files/zh-cn/web/html/element/br/index.html b/files/zh-cn/web/html/element/br/index.html new file mode 100644 index 0000000000..aa3e6ea144 --- /dev/null +++ b/files/zh-cn/web/html/element/br/index.html @@ -0,0 +1,113 @@ +--- +title:
+slug: Web/HTML/Element/br +translation_of: Web/HTML/Element/br +--- +

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

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

属性

+ +

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

+ +
+
{{htmlattrdef("clear")}} {{deprecatedGeneric('inline','HTML4.01')}} {{obsoleteGeneric('inline','HTML5')}}
+
指定换行后下一行文本开始位置。 +
+

使用注意: 此属性在 {{HTMLVersionInline(5)}} 中已被废弃,请勿使用。 请用 {{CSSxref('clear')}} 属性替代。

+
+
+
+ +

注意

+ +

不要用 <br> 来增加文本之间的行间隔;应使用 CSS {{cssxref('margin')}} 属性或{{HTMLElement("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

+ +

技术规范

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'semantics.html#the-br-element', '<br>')}}{{Spec2('HTML WHATWG')}} 
{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-br-element', '<br>')}}{{Spec2('HTML5 W3C')}} 
{{SpecName('HTML4.01', 'struct/text.html#h-9.3.2.1', '<br>')}}{{Spec2('HTML4.01')}} 
+ +

浏览器兼容性

+ + + +

{{Compat("html.elements.br")}}

+ +

参见

+ + + +
{{HTMLRef}}
-- cgit v1.2.3-54-g00ecf