unicode-bidi
unicode-bidi
unicode-bidi
CSS属性,与direction
属性一同,决定如何对文档中的双向文本进行处理。例如,如果内容块同时包含从左到右和从右到左的文本,则用户代理使用复杂的Unicode算法来决定如何显示文本。该unicode-bidi
属性重写此算法,并允许开发人员控制文本嵌入。
unicode-bidi
和direction
属性是两个不会受简写属性all
影响的属性。
注意:
此属性用于文档类型定义(DTD)设计器。网页设计师和类似的作者不应该重写它。
/* 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;
Initial value | normal |
---|---|
Applies to | all elements, though some values have no effect on non-inline elements |
Inherited | no |
Media | visual |
Computed value | as specified |
Animation type | discrete |
Canonical order | the unique non-ambiguous order defined by the formal grammar |
语法
可能值
normal
——对于双向算法,元素不提供额外的嵌入级别。对于内联元素,在元素边界上隐式重排序。
该值允许显示已经使用Unicode双向算法工具格式化的数据。
形式语法
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>
结果
规范
Specification | Status | Comment |
---|---|---|
CSS Writing Modes Module Level 3The definition of 'unicode-bidi' in that specification. | Candidate Recommendation | Added plaintext, isolate, and isolate-override keywords. |
CSS Level 2 (Revision 1)The definition of 'unicode-bidi' in that specification. | Recommendation | Initial definition. |
浏览器兼容性
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | 2.0 | (Yes) | 1.0 (1.7 or earlier) | 5.5 | 9.2 | 1.3 |
isolate | 16 -webkit1 48.0 | No support | 10 (10) -moz2 50 (50)6 | No support | No support | -webkit4 |
plaintext | 48.0 | No support | 10 (10) -moz 50 (50)5 | No support | No support | No support |
isolate-override | 48.0 | No support | 17 (17) -moz 50 (50)6 | No support | No support | No support |
Feature | Android | Android Webview | Edge | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support | 1.0 | (Yes) | (Yes) | 1.0 (1.0) | 6 | 8 | 3.1 | (Yes) |
isolate | ? | 48.0 | No support | 10.0 (10) -moz 50.0 (50)6 | No support | No support | No support | 48.0 |
plaintext | No support | 48.0 | No support | 10.0 (10) -moz3 50.0 (50)5 | No support | No support | No support | 48.0 |
isolate-override | No support | 48.0 | No support | 17.0 (17) -moz 50.0 (50)6 | No support | No support | No support | 48.0 |