如何在mozilla中更改滚动条样式? [英] How to change scrollbar style in mozilla?
本文介绍了如何在mozilla中更改滚动条样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图改变滚动条样式。我写了css代码,它在chrome中工作,但在Mozilla中不起作用。
如何解决这个问题?
我尝试过:
iam trying to change scrollbar style. i have written css code, it is working in chrome but not working in Mozilla.
How can i solve this issue?
What I have tried:
<pre>::-webkit-scrollbar-track{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
background-color: #F5F5F5;
}
::-webkit-scrollbar{
width: 10px;
background-color: #F5F5F5;
}
::-webkit-scrollbar-thumb{
background-color: #0d9b6e;
background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.5, transparent), to(transparent));
}
推荐答案
Firefox不支持自定义滚动条颜色。有一个要求添加这个已开放16年,没有解决方案的迹象:
77790 - (滚动条颜色)样式滚动条(绑定:: - moz-horizontal-scrollbar to XBL) [ ^ ]
如果你真的需要设置滚动条的样式,那么你就是需要一个隐藏它们的解决方案并用自定义元素替换它们。例如: jScrollPane - 使用jQuery和CSS交叉浏览器样式滚动条 [ ^ ]
注意:你的风格也不会在IE或Edge工作。在IE中,您可以使用不同的语法(scrollbar-face-color
)修改颜色。 Edge不支持IE或Chrome选项,因此您需要再次使用jScrollPane等自定义解决方案。
我可以使用... CSS滚动条样式 [ ^ ]
Firefox doesn't support custom scrollbar colours. There's a request to add this that's been open for 16 years, with no sign of a resolution:
77790 - (scrollbar-colors) Style the scrollbar (binding ::-moz-horizontal-scrollbar to XBL)[^]
If you really need to style the scrollbars, then you're going to need a solution which hides them and replaces them with custom elements. For example: jScrollPane - cross browser styleable scrollbars with jQuery and CSS[^]
NB: Your styles also won't work in IE or Edge. In IE, you can modify the colour using a different syntax (scrollbar-face-color
). Edge does not support either the IE or Chrome options, so once again, you'll need a custom solution like jScrollPane.
Can I use... CSS scrollbar styling[^]
这篇关于如何在mozilla中更改滚动条样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文