HTML中错误的RTL布局-CSS覆盖不起作用

问题描述 投票:1回答:2

以某种方式CSS覆盖dir =“ rtl”下的(left | right)似乎不起作用。

要验证-在Chrome / Firebug中:仅当禁用“ left”属性时,覆盖的“ left”样式(在.dir_rtl #main_search_wrapper下)才会开始影响实际布局。

看起来像是常见的浏览器错误?

这是下面的代码的实时示例:http://jsfiddle.net/DwRLz/

#main_search_wrapper {
  display: inline-block;
  position: absolute;
  right: 0;
}

.dir_rtl #main_search_wrapper {
  left: 0;
  /* <-- This should override the above style */
}
<body class="dir_rtl" dir="rtl">
  <div id="main_search_wrapper" style="display: inline-block;">
    This should be aligned to the left.
  </div>
</body>
html css overriding right-to-left
2个回答
5
投票

0
投票
© www.soinside.com 2019 - 2024. All rights reserved.