<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 5 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 5 年前。
我在 html 外部和内部有两个 div,所以我希望外部 div 有一个滚动条覆盖,我的 html 如下所示:
<div class="outer">
<div class="inner">
</div>
</div>
我已经在 css 中尝试过了
.outer{
position: absolute;
left: 0;
width: 300px;
height: 95vh;
overflow-x: hidden;
overflow-y: hidden;
}
.outer:hover{
overflow-y: auto;
}
.inner{
width 100%;
height 100%;
position:absolute;
}
最佳答案
我只是复制了您的代码,并且在我的 div
中有了滚动条。
我将 CSS 添加到自定义滚动条。
Here我的 JSfiddle。
关于html - 如何在CSS中做覆盖滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48066280/