【发布时间】:2020-03-30 02:06:41
【问题描述】:
我的网站内容很长 - 所以网站必须是垂直可滚动的。但是,页面底部也有水平滚动的 div。不幸的是,在用户向下滚动之前,该元素的水平滚动条是不可见的。有没有办法在屏幕底部显示水平滚动条? Here 就是例子。
.container {
overflow-y: auto;
overflow-x: hidden;
}
.content {
background-color: lightblue;
height: 5rem;
}
.scrollable-content {
background-color: lightgreen;
height: 100vh;
overflow-x: auto;
width: 100%;
}
.wide-content {
width: 150vw;
}
<div class="container">
<div class="content">
Div which is not horizontally scrollable
</div>
<div class="scrollable-content">
Div which is horizontally scrollable
<div class="wide-content">
Some wide content
</div>
</div>
</div>
【问题讨论】:
-
我也有同样的问题,想知道您是否找到了解决方案?