CSS3 / webkit:如何更改滚动条滑块的大小?
小提琴: http://jsfiddle.net/vVJGD/
::-webkit-scrollbar{
width: 10px;
padding-top: 40px;
}
::-webkit-scrollbar-track{
-webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0.3);
border: 1px solid black;
background: rgb(41,41,41);
border-radius: 10px;
}
::-webkit-scrollbar-thumb{
border-radius:10px;
height: 30px;
width: 8px;
border: 1px solid black;
background: rgb(111,111,111);
-webkit-box-shadow: 0 1px 1px rgb(0,0,0);
background: -webkit-linear-gradient(rgb(200,200,200), rgb(150,150,150));
}
::-webkit-scrollbar-track-piece {
height: 30px;
}
我尝试通过 track-piece 设置高度和拇指,但我认为这不是正确的方法。
有人知道其中的秘密吗?我在谷歌上没有找到任何具体的东西。
fiddle: http://jsfiddle.net/vVJGD/
::-webkit-scrollbar{
width: 10px;
padding-top: 40px;
}
::-webkit-scrollbar-track{
-webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0.3);
border: 1px solid black;
background: rgb(41,41,41);
border-radius: 10px;
}
::-webkit-scrollbar-thumb{
border-radius:10px;
height: 30px;
width: 8px;
border: 1px solid black;
background: rgb(111,111,111);
-webkit-box-shadow: 0 1px 1px rgb(0,0,0);
background: -webkit-linear-gradient(rgb(200,200,200), rgb(150,150,150));
}
::-webkit-scrollbar-track-piece {
height: 30px;
}
I've tried to set the height via track-piece and thumb, but I don't think that's the correct way.
Anyone know the secret? I didn't find anything on google this specific.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(2)
设置
height
和width
属性:http://jsfiddle .net/vVJGD/8/,Webkit 会将它们分配到适当的方向。Set the
height
andwidth
properties: http://jsfiddle.net/vVJGD/8/, Webkit will assign them to the appropriate orientation.是的,这是可能的。我们可以在css中编辑样式:
Yes, it is possible. We can edit in the css the style: