如何在 Firefox 中隐藏滚动条? [英] How to hide scrollbar in Firefox?

查看:77
本文介绍了如何在 Firefox 中隐藏滚动条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚发现了如何在谷歌浏览器中隐藏滚动条,我用这个代码做到了:

I just found out how to hide the scrollbar in Google Chrome, I did it with this code:

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

唯一的问题是这在 Firefox 上不起作用.我尝试了很多方法,但还是不行.

The only problem is that this doesn't work on Firefox. I tried many ways to do it but it still doesn't work.

推荐答案

您可以使用 scrollbar-width 规则.您可以 scrollbar-width: none; 在 Firefox 中隐藏滚动条,但仍然可以自由滚动.

You can use the scrollbar-width rule. You can scrollbar-width: none; to hide the scrollbar in Firefox and still be able to scroll freely.

body {
   scrollbar-width: none;
}

这篇关于如何在 Firefox 中隐藏滚动条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆