隐藏滚动条,但仍可以滚动

我只是一个虾纸丫 提交于 2020-08-11 22:24:23

问题:

I want to be able to scroll through the whole page, but without the scrollbar being shown. 我希望能够滚动浏览整个页面,但不显示滚动条。

In Google Chrome it's: 在Google Chrome浏览器中:

::-webkit-scrollbar {
    display: none;
}

But Mozilla Firefox and Internet Explorer don't seem to work like that. 但是Mozilla Firefox和Internet Explorer似乎无法正常工作。

I also tried this in CSS: 我也在CSS中尝试过:

overflow: hidden;

That does hide the scrollbar, but I can't scroll any more. 那确实隐藏了滚动条,但是我不能再滚动了。

Is there a way I can remove the scrollbar while still being able to scroll the whole page? 有什么办法可以删除滚动条,同时仍然可以滚动整个页面?

With just CSS or HTML, please. 请仅使用CSS或HTML。


解决方案:

参考一: https://stackoom.com/question/17wrz/隐藏滚动条-但仍可以滚动
参考二: https://oldbug.net/q/17wrz/Hide-scroll-bar-but-while-still-being-able-to-scroll
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!