如何在 Chrome 中制作细滚动条?

Ala*_*min 17 html css sass

我在 Firefox 中为此 css 制作了细滚动条:

  scrollbar-width: thin;
  scrollbar-color: rgba(155, 155, 155, 0.5) transparent; 
Run Code Online (Sandbox Code Playgroud)

它适用于火狐浏览器。

现在我需要在 Chrome 中制作细滚动条。我试过这个CSS

*-webkit-scrollbar {
  width: 9px;
}
*-webkit-scrollbar-track {
  background: transparent;
}
*-webkit-scrollbar-thumb {
  background-color: rgba(155, 155, 155, 0.5);
  border-radius: 20px;
  border: transparent;
}
Run Code Online (Sandbox Code Playgroud)

但这段代码在chrome中不起作用。

任何建议请。

小智 45

尝试这个:-

::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(155, 155, 155, 0.5);
  border-radius: 20px;
  border: transparent;
}
Run Code Online (Sandbox Code Playgroud)