以下是代码:
<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
),我设置了position
,right
,padding-right
和writing-mode
属性。但它在Chrome和Edge中的布局不同。
它在Microsoft Edge和Firefox中显示如下。
see screenshot
但在Chrome中,.content
的正确填充超出了.container
。
see screenshot
这是Chrome的已知错误吗?以及如何解决这个问题?
抱歉我的英文不好,谢谢你的回答! :)
答案 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>