本文介绍了为什么滚动条即使向左突出也没有出现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了此代码.这会在右侧溢出,从而导致出现滚动条:

I created this code. This overflows to the right, which causes a scrollbar to appear:

.content {
  position: absolute;
  height: 100px;
  width: 100px;
  right: -50px;
  top: 50px;
}
<div class="content">
  CONTENT
</div>

但是,此代码向左扩展,并没有生成滚动条.我从W3C规范中解释说,这将在两个方向上创建滚动条.

However, this code, which extends to the left, did not generate scrollbars. I interpreted from the W3C specification that this would create scrollbars in both directions.

.content {
  position: absolute;
  height: 100px;
  width: 100px;
  left: -50px;
  top: 50px;
}
<div class="content">
  CONTENT
</div>

W3C规范是否解释了为什么向左投影时不生成滚动条?

Does the W3C specification explain why scrollbars are not generated when projecting to the left?

推荐答案

这是来自第3.3节.滚动原点,方向和限制

换句话说,溢出在两侧都发生.但这是已裁剪.

In other words, the overflow notionally happens on both sides. But it is clipped.

这篇关于为什么滚动条即使向左突出也没有出现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 00:24