CSS设置滚动样式, 鼠标离开时滚动条隐藏
CSS样式代码
css设置滚动条透明的方法是,给滚动条添加样式【::-webkit-scrollbar {height: 0;width: 0;color: transparent;}】就可以了。
操作环境
windows10系统、css 3、thinkpad t480电脑。
CSS设置滚动样式代码
body:hover{
overflow:scroll;
}
::-webkit-scrollbar
{
width: 20px !important;
}
::-webkit-scrollbar-thumb
{
border-radius: 10px;
border-style: dashed;
border-color: transparent;
border-width: 3px;
background-clip: padding-box;
background-color: rgba(157, 165, 183, 0.5);
}