unicode-bidi CSS property, together with the direction property, determines how bidirectional text in a document is handled. For example, if a block of content contains both left-to-right and right-to-left text, the user-agent uses a complex Unicode algorithm to decide how to display the text. The unicode-bidi property overrides this algorithm and allows the developer to control the text embedding.

unicode-bidi and direction properties are the only properties that are not affected by the all shorthand.

注意: This property is intended for Document Type Definition (DTD) designers. Web designers and similar authors should not override it.

/* Keyword values */
unicode-bidi: normal;
unicode-bidi: embed;
unicode-bidi: isolate;
unicode-bidi: bidi-override;
unicode-bidi: isolate-override;
unicode-bidi: plaintext;
/* Global values */
unicode-bidi: inherit;
unicode-bidi: initial;
unicode-bidi: unset;
					

句法

normal

The element does not offer an additional level of embedding with respect to the bidirectional algorithm. For inline elements, implicit reordering works across element boundaries.

embed
If the element is inline, this value opens an additional level of embedding with respect to the bidirectional algorithm. The direction of this embedding level is given by the direction 特性。
bidi-override
For inline elements this creates an override. For block container elements this creates an override for inline-level descendants not within another block container element. This means that inside the element, reordering is strictly in sequence according to the direction property; the implicit part of the bidirectional algorithm is ignored.
isolate
This keyword indicates that the element's container directionality should be calculated without considering the content of this element. The element is therefore isolated from its siblings. When applying its bidirectional-resolution algorithm, its container element treats it as one or several U+FFFC Object Replacement Character , i.e. like an image.
isolate-override
This keyword applies the isolation behavior of the isolate keyword to the surrounding content and the override behavior of the bidi-override keyword to the inner content.
plaintext
This keyword makes the elements directionality calculated without considering its parent bidirectional state or the value of the direction property. The directionality is calculated using the P2 and P3 rules of the Unicode Bidirectional Algorithm.
This value allows the display of data that is already formatted using a tool following the Unicode Bidirectional Algorithm.

形式定义

初始值 normal
适用于 all elements, though some values have no effect on non-inline elements
继承 no
计算值 如指定
动画类型 discrete

形式句法

normal | embed | isolate | bidi-override | isolate-override | plaintext
					

范例

CSS

.bible-quote {
  direction: rtl;
  unicode-bidi: embed;
}
					

HTML

<div class="bible-quote">
  A line of text
</div>
<div>
  Another line of text
</div>
					

结果

规范

规范 状态 注释
CSS Writing Modes Module Level 3
The definition of 'unicode-bidi' in that specification.
Proposed Recommendation 添加 plaintext , isolate ,和 isolate-override keywords.
CSS Level 2 (Revision 1)
The definition of 'unicode-bidi' in that specification.
推荐 初始定义。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
unicode-bidi Chrome 完整支持 2 Edge 完整支持 12 Firefox 完整支持 1 IE 完整支持 5.5 Opera 完整支持 9.2 Safari 完整支持 1.3 WebView Android 完整支持 1 Chrome Android 完整支持 18 Firefox Android 完整支持 4 Opera Android 完整支持 10.1 Safari iOS 完整支持 3.1 Samsung Internet Android 完整支持 1.0
isolate Chrome 完整支持 48
完整支持 48
完整支持 16 Prefixed 注意事项
Prefixed Implemented with the vendor prefix: -webkit-
注意事项 Avoiding using -webkit-isolate . It can lock up older versions of Safari (up to version 9) and Chrome (up to version 47).
注意事项 Since Chrome 19, the syntax from a previous version of the specification, where the isolate keyword could be used together with bidi-override , is allowed.
Edge 完整支持 79 Firefox 完整支持 50
完整支持 50
不支持 10 — 54 Prefixed 注意事项
Prefixed Implemented with the vendor prefix: -moz-
注意事项 From Firefox 10 to Firefox 16 (inclusive), the isolate keyword could be used together with bidi-override , which was the syntax from a previous version of the specification. From Firefox 17, only one value is allowed. Use isolate-override instead the previous isolate bidi-override .
IE 不支持 No Opera 完整支持 35
完整支持 35
完整支持 15 Prefixed 注意事项
Prefixed Implemented with the vendor prefix: -webkit-
注意事项 Avoiding using -webkit-isolate . It can lock up older versions of Opera (up to version 34).
注意事项 The syntax from a previous version of the specification, where the isolate keyword could be used together with bidi-override , is allowed.
Safari 完整支持 6 Prefixed 注意事项
完整支持 6 Prefixed 注意事项
Prefixed Implemented with the vendor prefix: -webkit-
注意事项 Avoiding using -webkit-isolate . It can lock up older versions of Safari (up to version 9) and Chrome (up to version 47).
WebView Android 完整支持 48 Chrome Android 完整支持 48 Firefox Android 完整支持 50
完整支持 50
不支持 10 — 54 Prefixed 注意事项
Prefixed Implemented with the vendor prefix: -moz-
注意事项 From Firefox 10 to Firefox 16 (inclusive), the isolate keyword could be used together with bidi-override , which was the syntax from a previous version of the specification. From Firefox 17, only one value is allowed. Use isolate-override instead the previous isolate bidi-override .
Opera Android 完整支持 35 Safari iOS 完整支持 6 Prefixed 注意事项
完整支持 6 Prefixed 注意事项
Prefixed Implemented with the vendor prefix: -webkit-
注意事项 Avoiding using -webkit-isolate . It can lock up older versions of Safari (up to version 9) and Chrome (up to version 47).
Samsung Internet Android 完整支持 5.0
isolate-override Chrome 完整支持 48 Edge 完整支持 79 Firefox 完整支持 50
完整支持 50
不支持 17 — 54 Prefixed
Prefixed Implemented with the vendor prefix: -moz-
IE 不支持 No Opera 完整支持 35 Safari 不支持 No WebView Android 完整支持 48 Chrome Android 完整支持 48 Firefox Android 完整支持 50
完整支持 50
不支持 17 — 54 Prefixed
Prefixed Implemented with the vendor prefix: -moz-
Opera Android 完整支持 35 Safari iOS 不支持 No Samsung Internet Android 完整支持 5.0
plaintext Chrome 完整支持 48 Edge 完整支持 79 Firefox 完整支持 50
完整支持 50
不支持 10 — 54 Prefixed 注意事项
Prefixed Implemented with the vendor prefix: -moz-
注意事项 Before Firefox 50, the plaintext value was ignored for vertical writing modes ( bug 1302734 ).
注意事项 Before Firefox 15, plaintext didn't do anything to an inline element. The specification changed and the implementation was changed in Firefox 15.
IE 不支持 No Opera 完整支持 35 Safari 不支持 No WebView Android 完整支持 48 Chrome Android 完整支持 48 Firefox Android 完整支持 50
完整支持 50
不支持 10 — 54 Prefixed 注意事项
Prefixed Implemented with the vendor prefix: -moz-
注意事项 Before Firefox 50, the plaintext value was ignored for vertical writing modes ( bug 1302734 ).
注意事项 Before Firefox 15, plaintext didn't do anything to an inline element. The specification changed and the implementation was changed in Firefox 15.
Opera Android 完整支持 35 Safari iOS 不支持 No Samsung Internet Android 完整支持 5.0

图例

完整支持

完整支持

不支持

不支持

见实现注意事项。

见实现注意事项。

要求使用供应商前缀或不同名称。

要求使用供应商前缀或不同名称。

另请参阅

元数据

  • 最后修改:
  1. CSS
  2. CSS 参考
  3. CSS Writing Modes
  4. 特性
    1. direction
    2. text-combine-upright
    3. text-orientation
    4. unicode-bidi
    5. writing-mode

Copyright  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1