在Firefox中隐藏滚动条 [英] Hide scrollbar in firefox

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

问题描述

我想在页面中隐藏一个滚动条,但是我可以像滚动条一样滚动。
所以我不能使用overflow:隐藏,因为我希望我可以像普通
一样滚动,但看不到滚动条。

I want to hide a scroll bar in page but I can scroll like it has a scroll bar. so I cant use overflow:hidden because I want that I can scroll like normal but cannot see a scroll bar.

所以我使用这个css代码(class not-scroll-body是一个body标签类)

so I use this css code (class not-scroll-body is a class of body tag)

.not-scroll-body::-webkit-scrollbar {
    display: none; 
}

它适用于Chrome ,但是当我使用 -moz - 而不是 -webkit - 像这样

It works in Chrome , but when I use -moz- instead of -webkit- like this

.not-scroll-body::-moz-scrollbar {
    display: none; 
}

在Firefox中不起作用。

我能做些什么才能使它工作?

What can I do to to make it work?

感谢您的每一个回答,并为我的可怜英语感到抱歉语言:)

Thank you for every answer and sorry for my poor english language :)

推荐答案

根据 选择器。显然曾经是一个属性, -moz-scrollbars-none ,你可以使用它,但它已被删除,并且人们推荐使用 overflow:hidden 或者冒险 margin-right:-14px 解决方案。

According to this answer and everything I've been able to find on the web, there's no Firefox equivalent of the -webkit-scrollbar selector. Apparently there used to be a property, -moz-scrollbars-none, that you could use for this, but it's since been removed and people recommend using overflow:hidden or a hackish margin-right: -14px solution.

抱歉,我无法提供更多帮助 - 看起来好像没有Firefox方式可以优雅地完成这项工作。

Sorry I can't be more helpful -- it seems like there's no Firefox way to do this elegantly.

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

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