CSS

unicode-bidi

unicode-bidi

unicode-bidi CSS属性,与direction属性一同,决定如何对文档中的双向文本进行处理。例如,如果内容块同时包含从左到右和从右到左的文本,则用户代理使用复杂的Unicode算法来决定如何显示文本。该unicode-bidi属性重写此算法,并允许开发人员控制文本嵌入。

unicode-bididirection属性是两个不会受简写属性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 valuenormal
Applies toall elements, though some values have no effect on non-inline elements
Inheritedno
Mediavisual
Computed valueas specified
Animation typediscrete
Canonical orderthe 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>

结果

规范

SpecificationStatusComment
CSS Writing Modes Module Level 3The definition of 'unicode-bidi' in that specification.Candidate RecommendationAdded plaintext, isolate, and isolate-override keywords.
CSS Level 2 (Revision 1)The definition of 'unicode-bidi' in that specification.RecommendationInitial definition.

浏览器兼容性

FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support2.0(Yes)1.0 (1.7 or earlier)5.59.21.3
isolate16 -webkit1 48.0No support10 (10) -moz2 50 (50)6No supportNo support-webkit4
plaintext48.0No support10 (10) -moz 50 (50)5No supportNo supportNo support
isolate-override48.0No support17 (17) -moz 50 (50)6No supportNo supportNo support

FeatureAndroidAndroid WebviewEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari MobileChrome for Android
Basic support1.0(Yes)(Yes)1.0 (1.0)683.1(Yes)
isolate?48.0No support10.0 (10) -moz 50.0 (50)6No supportNo supportNo support48.0
plaintextNo support48.0No support10.0 (10) -moz3 50.0 (50)5No supportNo supportNo support48.0
isolate-overrideNo support48.0No support17.0 (17) -moz 50.0 (50)6No supportNo supportNo support48.0