html - 为什么 "[x]y"在RTL方向显示不正确?

标签 html css right-to-left

<div style="direction: rtl">
[x]y
</div>

您可以看到 HTML 文本 [x]y 显示为 x]y]

这个结果的原因是什么?

PS:我在 Chrome 56.0.2924.87(64 位)中得到了这个结果。

最佳答案

我不能告诉你原因,但我可以告诉你如何解决它:添加 unicode-bidi: bidi-override;。参见 more关于它

<div style="direction: rtl; unicode-bidi: bidi-override;">
[x]y
</div>

描述

The unicode-bidi property is used together with the direction property to set or return whether the text should be overridden to support multiple languages in the same document.

不够清楚,无法解释该行为。但是,它有效。

编辑

The MDN article在这里带来了一些启发,bidi-override 实际上禁用了浏览器标准智能行为,并且一切都按原样/按预期工作。

关于html - 为什么 "[x]y"在RTL方向显示不正确?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43973319/

相关文章:

html - 表格中 <td> 元素下的 CSS 三 Angular 形

html - CSS 菜单下拉悬停问题

css - 右对齐 div 的内容,同时保持输入字段中的文本方向为 ltr

html - 限制文字宽度

android - 在 gridLayout 中从右到左放置项目

winforms - 禁用数字替换

html - 增加菜单上方的填充

html - 具有圆形边框和行间边框的表格

javascript - 在一段中添加多个 "Read More"链接 (readmore.js)

html - 是否可以仅使用 CSS 修改父节点子节点(包括原始节点的悬停)的外观?