简体   繁体   English

::-webkit-scrollbar 在 firefox 上不起作用

[英]::-webkit-scrollbar not working on firefox

Firefox Webkit Scroll not working Firefox Webkit 滚动不起作用

.services::-webkit-scrollbar {
     width: 2px;
     height: 2px;
}

Note:- Please suggest some way to resolve this issue as soon as possible.注意:- 请尽快提出一些解决此问题的方法。

How to resolve this issue using JS/css??如何使用 JS/css 解决这个问题?

Try this, it will definitely work试试这个,它肯定会工作

scroll-snap-type: mandatory;
scrollbar-width: none;

Firefox IS NOT a WebKit browser... Therefore, a vendor prefix for Webkit browsers (Chrome, Edge, Safari) isn't going to have any effect on Firefox's rendering. Firefox 不是 WebKit 浏览器...因此,Webkit 浏览器(Chrome、Edge、Safari)的供应商前缀不会对 Firefox 的渲染产生任何影响。

I highly recommend you add something like Autoprefixer to your build pipeline.我强烈建议您将Autoprefixer 之类的东西添加到您的构建管道中。 It will manage adding prefixes where needed, not adding them in places where they're not needed (eg border-radius ) and let you focus on writing standards-compliant CSS.它将管理在需要的地方添加前缀,而不是在不需要的地方添加它们(例如border-radius ),让您专注于编写符合标准的 CSS。 (even though it won't help in this case where you're targeting vendor-specific selectors) (即使在这种情况下您针对特定于供应商的选择器没有帮助)

for reference Mozilla based browsers use the prefix -moz-作为参考,基于 Mozilla 的浏览器使用前缀-moz-

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM