如何在不显示滚动条的情况下滚动div? [英] How Can I scroll through a div without the scrollbars showing?
本文介绍了如何在不显示滚动条的情况下滚动div?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下CSS,但滚动条可见.如何使它们不可见(没有滚动条的可滚动div)?
I have the following css but the scroll bars are visible. how can I make them invisible (scrollable div without scrollbars)?
.myDiv
{
height:300px;
overflow: scroll;
}
推荐答案
.myDiv {
width: 200px;
height:300px;
overflow: scroll;
}
.wrapper {
width: 183px;
height: 283px;
overflow: hidden;
border: 1px solid black;
}
<div class="wrapper">
<div class="myDiv">
floating div content...
</div>
</div>
这可能有效-基本上,您是在想要的div周围放置一个较小的div,并隐藏滚动条.
This might work - basically you're placing a smaller div around the one you want and hiding the scroll bars.
这篇关于如何在不显示滚动条的情况下滚动div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文