diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/html/element/bdi | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/html/element/bdi')
-rw-r--r-- | files/zh-cn/web/html/element/bdi/index.html | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/files/zh-cn/web/html/element/bdi/index.html b/files/zh-cn/web/html/element/bdi/index.html new file mode 100644 index 0000000000..03d0f69f37 --- /dev/null +++ b/files/zh-cn/web/html/element/bdi/index.html @@ -0,0 +1,103 @@ +--- +title: <bdi> +slug: Web/HTML/Element/bdi +tags: + - BiDi + - Element + - HTML + - HTML text-level semantics + - Reference + - Web +translation_of: Web/HTML/Element/bdi +--- +<h2 id="Summary">Summary</h2> + +<p>{{HTMLRef}}<br> + <strong>HTML </strong>双向隔离元素(<strong> <code><bdi></code> </strong>) 告诉浏览器的双向算法将其包含的文本与周围的文本隔离,当网站动态插入一些文本且不知道所插入文本的方向性时,此功能特别有用。</p> + +<p>{{EmbedInteractiveExample("pages/tabbed/bdi.html", "tabbed-standard")}}</p> + + + +<p class="note">尽管同样的显示效果可以通过使用CSS规则 {{cssxref("unicode-bidi")}}:隔离{{HTMLElement("span")}}或者其他文本格式化元素,但语义信息只能通过<bdi>元素传递。特别是,当浏览器允许忽略CSS样式时,在这种情况下,使用<bdi>仍然可以保证文本正确显示,而使用CSS样式来传递语义时就显得毫无用处。</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row"><a href="/en-US/docs/HTML/Content_categories" title="HTML/Content_categories">Content categories</a></th> + <td><a href="/en-US/docs/HTML/Content_categories#Flow_content" title="HTML/Content categories#Flow content">Flow content</a>, <a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="HTML/Content_categories#Phrasing_content">phrasing content</a>, palpable content.</td> + </tr> + <tr> + <th scope="row">Permitted content</th> + <td><a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="HTML/Content_categories#Flow_content">Phrasing content</a>.</td> + </tr> + <tr> + <th scope="row">Tag omission</th> + <td>{{no_tag_omission}}</td> + </tr> + <tr> + <th scope="row">Permitted parent elements</th> + <td>Any element that accepts <a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="HTML/Content_categories#Flow_content">phrasing content</a>.</td> + </tr> + <tr> + <th scope="row">DOM interface</th> + <td>{{domxref("HTMLElement")}}</td> + </tr> + </tbody> +</table> + +<h2 id="属性">属性</h2> + +<p>{{htmlattrdef("dir")}}</p> + +<p>如同其他HTML元素一样,它包含<a href="/en-US/docs/HTML/Global_attributes" title="HTML/Global attributes">全局属性</a>,但是有一些语义上的细微差别:<strong>dir</strong>属性不继承父元素。如果没有设置,默认值即为auto,以便浏览器根据元素内容决定元素内容的方向。</p> + +<h2 id="示例">示例</h2> + +<pre class="brush: html"><p dir="ltr">This arabic word <bdi>ARABIC_PLACEHOLDER</bdi> is automatically displayed right-to-left.</p> +</pre> + +<h3 id="结果">结果</h3> + +<p dir="ltr">This arabic word REDLOHECALP_CIBARA is automatically displayed right-to-left.</p> + +<h2 id="Specifications" name="Specifications">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-bdi-element', '<bdi>')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td></td> + </tr> + <tr> + <td>{{SpecName('HTML5 W3C', 'the-bdi-element.html#the-bdi-element', '<bdi>')}}</td> + <td>{{Spec2('HTML5 W3C')}}</td> + <td></td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容">浏览器兼容</h2> + + + + + +<p>{{Compat("html.elements.bdi")}}</p> + + + +<h2 dir="ltr" id="参见">参见</h2> + +<ul> + <li>相关元素: {{HTMLElement("bdo")}}</li> + <li>相关属性: {{cssxref("direction")}}, {{cssxref("unicode-bidi")}}</li> +</ul> |