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/wbr/index.html | 94 +++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 files/zh-cn/web/html/element/wbr/index.html (limited to 'files/zh-cn/web/html/element/wbr/index.html') diff --git a/files/zh-cn/web/html/element/wbr/index.html b/files/zh-cn/web/html/element/wbr/index.html new file mode 100644 index 0000000000..4b816ce233 --- /dev/null +++ b/files/zh-cn/web/html/element/wbr/index.html @@ -0,0 +1,94 @@ +--- +title: +slug: Web/HTML/Element/wbr +tags: + - Element + - HTML + - HTML text-level semantics + - Reference + - Web +translation_of: Web/HTML/Element/wbr +--- +
{{HTMLRef}}
+ +

HTML <wbr> 元素  — 一个文本中的位置,其中浏览器可以选择来换行,虽然它的换行规则可能不会在这里换行。

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Content categoriesFlow content, phrasing content.
Permitted contentEmpty
Tag omissionIt is an {{Glossary("empty element")}}; it must have a start tag, but must not have an end tag.
Permitted parentsAny element that accepts phrasing content.
Permitted ARIA rolesAny
DOM interface{{domxref("HTMLElement")}}
+ +

属性

+ +

这个元素仅仅包含 全局属性

+ +

Notes

+ +

在 UTF-8 编码的页面中, <wbr> 表现为 U+200B ZERO-WIDTH SPACE (零宽空格)代码点。特别是,它表现为 Unicode bidi BN 代码点,也就是说,它对 bidi-ordering 没有影响:<div dir=rtl>123,<wbr>456</div> 展示 123,456 而不是 456,123,当不拆成的两行时候。

+ +

出于相同原因, <wbr>元素不会在换行的地方引入连字符。为了使连字符仅仅在行尾出现,使用连字符软实体 (&shy;) 来代替。

+ +

这个元素首先在 Internet Explorer 5.5 中实现,并且在 HTML5 中官方定义。

+ +

示例

+ +

Yahoo 代码规范 推荐 在标点之前为 URL 换行,以便避免将标点符号留在行尾,这会让读者将 URL 的末尾搞错。

+ +
<p>http://this<wbr>.is<wbr>.a<wbr>.really<wbr>.long<wbr>.example<wbr>.com/With<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages</p>
+
+ +

{{EmbedLiveSample("示例")}}

+ +

规范

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'semantics.html#the-wbr-element', '<wbr>')}}{{Spec2('HTML WHATWG')}} 
{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-wbr-element', '<wbr>')}}{{Spec2('HTML5 W3C')}} 
+ +

浏览器兼容性

+ + + +

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

-- cgit v1.2.3-54-g00ecf