小编Céc*_*ron的帖子

正文设置为溢出-y:隐藏但页面仍可在Chrome中滚动

overflow-y在Chrome中遇到了该属性的问题.即使我已将其设置为hidden,我仍然可以使用鼠标滚轮滚动页面.

这是我的代码:

html,
body {
  overflow-y: hidden;
}

#content {
  position: absolute;
  width: 100%;
}

.step {
  position: relative;
  height: 500px;
  margin-bottom: 500px;
}
Run Code Online (Sandbox Code Playgroud)
<body>
  <div id="content">
    <div class="step">this is the 1st step</div>
    <div class="step">this is the 2nd step</div>
    <div class="step">this is the 3rd step</div>
  </div>
</body>
Run Code Online (Sandbox Code Playgroud)

有人知道如何阻止Chrome中的垂直滚动吗?

谢谢!

css scroll google-chrome overflow scrollbar

23
推荐指数
3
解决办法
9万
查看次数

标签 统计

css ×1

google-chrome ×1

overflow ×1

scroll ×1

scrollbar ×1