padding-right在使用书写模式时不起作用:在Chrome中使用vertical-rl和position:absolute

时间:2017-06-28 07:50:54

标签: css google-chrome

以下是代码:

<div
class="container"
style="position: relative;width: 400px;height: 400px;border: solid black;">
<div
class="content"
style="position: absolute;right: 0;writing-mode: vertical-rl;
padding-right: 50px;">Some text</div>
</div>

有两个盒子。我设置外框的边框和大小(.container)。所以,我们可以清楚地看到它。使用内框(.contanet),我设置了positionrightpadding-rightwriting-mode属性。但它在Chrome和Edge中的布局不同。

它在Microsoft Edge和Firefox中显示如下。 see screenshot
但在Chrome中,.content的正确填充超出了.containersee screenshot

这是Chrome的已知错误吗?以及如何解决这个问题?

抱歉我的英文不好,谢谢你的回答! :)

1 个答案:

答案 0 :(得分:0)

或者尝试这个。而不是位置使用显示属性。

<div
class="container"
style="display:block;text-align:end;width: 400px;height: 400px;border: solid black;">
<div
class="content"
style="display:inline-block;right: 0;writing-mode: vertical-rl;
padding-right: 50px;">Some text</div>
</div>