本文介绍了如何使用css更改滚动条颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试更改滚动条的颜色,但这里它不工作。
My jsfiddle is here
I trying to change the color of the scrollbar but here it is not working.
Css:
.flexcroll {
scrollbar-face-color: #367CD2;
scrollbar-shadow-color: #FFFFFF;
scrollbar-highlight-color: #FFFFFF;
scrollbar-3dlight-color: #FFFFFF;
scrollbar-darkshadow-color: #FFFFFF;
scrollbar-track-color: #FFFFFF;
scrollbar-arrow-color: #FFFFFF;
}
推荐答案
:
::-webkit-scrollbar { /* 1 */ }
::-webkit-scrollbar-button { /* 2 */ }
::-webkit-scrollbar-track { /* 3 */ }
::-webkit-scrollbar-track-piece { /* 4 */ }
::-webkit-scrollbar-thumb { /* 5 */ }
::-webkit-scrollbar-corner { /* 6 */ }
::-webkit-resizer { /* 7 */ }
根据的代码解释问题,工作小提琴与红色滚动条。
Here's a working fiddle with a red scrollbar, based on code from this page explaining the issues.
使用这个和你的解决方案,你可以处理除Firefox以外的所有浏览器,在这一点上,我认为还需要一个javascript解决方案。
Using this and your solution, you can handle all browsers except Firefox, which at this point I think still requires a javascript solution.
这篇关于如何使用css更改滚动条颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!