【问题标题】:Strange behaviour with direction: rtl and closing braces at the end of the sentence带有方向的奇怪行为:在句子末尾的 rtl 和右大括号
【发布时间】:2018-05-22 12:32:02
【问题描述】:

我有一些文本,末尾有一个大括号,包含的 div 具有 Css 属性direction: rtl;。这导致右大括号作为左大括号出现在句子的开头。

所以

Some text with (braces)

变成

(Some text with (braces

#strange-behaviour {
  direction: rtl;
}
<div id="strange-behaviour">
  Some text with (braces)
</div>

这是working fiddle

我的问题

如何激励右大括号保持右大括号?

【问题讨论】:

标签: css


【解决方案1】:

您可以在最后一个括号后添加 LRM 字符:

#strange-behaviour {
  direction: rtl;
}
<div id="strange-behaviour">
  Some text with (braces)&lrm;
</div>

【讨论】:

  • 谢谢,成功了。但我更喜欢使用&amp;lrm;,因为它具有更好的可读性。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-04-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-12-29
  • 1970-01-01
  • 2012-09-29
相关资源
最近更新 更多