Mad*_*Max 5 html css scrollbar
所以看起来该轨道是隐藏的。我的风格是这样的
::-webkit-scrollbar{
width: 15px;
height: 40px;
}
::-webkit-scrollbar-thumb{
background-color: #DBDBDB;
border: 4px solid transparent;
border-radius: 11px;
background-clip: content-box;
}
::-webkit-scrollbar * {
background: transparent;
}
::-webkit-scrollbar-thumb:vertical {
height: 90px;
}
Run Code Online (Sandbox Code Playgroud)
所以有一个问题。我怎样才能用 CSS 或 JS 做到这一点?谢谢
我认为这可能有效:
::-webkit-scrollbar-track {
border-radius: 10px;
background-color: transparent;
}
::-webkit-scrollbar-thumb {
-webkit-border-radius: 10px;
border-radius: 10px;
background: rgba(,0,0,0.5);
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}
Run Code Online (Sandbox Code Playgroud)
您可能需要根据您的需要对其进行编辑。