html - 我可以使用 css Direction-rtl < 和 > 交换吗?

标签 html css

我发现 css direction: rtl 会交换文本中的 <> 符号。我查看了 w3c 规范,但没有发现任何提及这一点的内容。问题是关于浏览器支持和可能的陷阱。哪些字符被这样替换?如果我使用带有 < 且不带 > 字符的自定义字体,会发生什么情况?

最佳答案

问题“哪些字符会被这样替换?”在 Unicode Character Database 中解决在标题属性定义下:

BidiMirroring.txt

Informative mapping for substituting characters in an implementation of bidirectional mirroring. This maps a subset of characters with the Bidi_Mirrored property to other characters that normally are displayed with the corresponding mirrored glyph. When a character with the Bidi_Mirrored property has the default value for Bidi_Mirroring_Glyph, that means that no other character exists whose glyph is appropriate for character-based glyph mirroring. Implementations must then use other mechanisms to implement mirroring of those characters for the Unicode Bidirectional Algorithm. See Unicode Standard Annex #9, "Unicode Bidirectional Algorithm" [UAX9]. Do not confuse this property with the Bidi_Mirrored property itself.

可以在此处找到 BidiMirroring.txt 文件:http://unicode.org/Public/UNIDATA/BidiMirroring.txt

包含

0028; 0029 # LEFT PARENTHESIS
0029; 0028 # RIGHT PARENTHESIS
003C; 003E # LESS-THAN SIGN
003E; 003C # GREATER-THAN SIGN
005B; 005D # LEFT SQUARE BRACKET
005D; 005B # RIGHT SQUARE BRACKET
007B; 007D # LEFT CURLY BRACKET
007D; 007B # RIGHT CURLY BRACKET

还有更多!

然后是浏览器支持:快速、肮脏且绝不权威的测试表明,IE8、FF3.6、Chrome 20 和 Opera 11 等老浏览器都支持它。

目前无法测试 > 的字体但没有<字形,抱歉。

关于html - 我可以使用 css Direction-rtl < 和 > 交换吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35765406/

相关文章:

jquery - 如何将我的 div 框更改为链接?

javascript - 如何将嵌套 map 假设为原型(prototype)?

javascript - 使用 <li> 标记附加输入值

html - 3 个内联 block div,宽度刚好为 33%,不适合父级

javascript - 用 jQuery 或 Javascript 替换 iFrame

javascript - 如何使用 javascript 更改 Canvas 的颜色?

javascript - 如何在不眨眼的情况下无缝更改背景图像?

javascript - 单击具有相同名称的第二类名称

HTML 包装器未正确填充页面

css - 如果条件为真则隐藏元素