我想制作透明的滚动条,它应该放在带有内容的div上.只有css和webkit浏览器.它看起来像是一个例子.我的代码.问题是滚动条将内容移动到左侧.如何让它看起来像在例子中?谢谢你的回复.
div{
width:410px;
height:100px;
overflow-y:scroll;
border:1px solid green;
position:relative;
}
::-webkit-scrollbar{
width:20px;
position:absolute;
right:20px;
z-index:100;
}
::-webkit-scrollbar-thumb{
background-color:rgba(0,0,0,1);
border-right:10px solid white;
}
Run Code Online (Sandbox Code Playgroud) 如何使滚动条透明?只有css.仅适用于webkit浏览器.我的代码在这里.
div{
width:410px;
height:100px;
overflow-y:overlay;
border:1px solid green;
position:relative;
}
::-webkit-scrollbar{
width:20px;
}
::-webkit-scrollbar-thumb{
background-color:rgba(0,0,0,1);
}
Run Code Online (Sandbox Code Playgroud)