白角webkit-scrollbar

Joe*_*ott 18 html css webkit css3

小提琴

::-webkit-scrollbar用来在Chrome中制作自定义滚动条.我有一个border-radius: 10px,在这样做,顶部有白色的角落:

这有点难看

对不起,这很难看,因为它是一个滚动条.

我希望角落与标题div(#dadae3)的颜色相同.有没有办法在不改变滚动条样式的情况下使用CSS摆脱白角?

CSS(整个):

body {
  padding: 0;
  margin: 0
}
::-webkit-scrollbar {
  width: 13px;
}
::-webkit-scrollbar-track {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #aeaeb5
}
::-webkit-scrollbar-thumb {
  background: #dadae3;
  border-radius: 10px;
  border: 1px solid #aeaeb5
}
::-webkit-scrollbar-thumb:hover {
  background: #c4c4cc
}
::-webkit-scrollbar-thumb:active {
  background: #aeaeb5
}
Run Code Online (Sandbox Code Playgroud)

HTML:

<div style='background: #dadae3; width: 100%; height: 30px;'></div>
<div style='width: 100%; height: 1000px'></div>
Run Code Online (Sandbox Code Playgroud)

Jas*_*lsa 34

你必须设置::-webkit-scrollbar-corner伪元素,例如

::-webkit-scrollbar-corner { background: rgba(0,0,0,0.5); }
Run Code Online (Sandbox Code Playgroud)

  • 这应该被接受:即使它已经晚了1年,它在chrome 43中给我带来了同样的问题 (3认同)