首页 前端知识 css改变滚动条宽度

css改变滚动条宽度

2024-06-24 23:06:27 前端知识 前端哥 578 724 我要收藏
.hello{
  width: 400px;
  height: 200px;
  border: 1px solid gray;
  overflow: auto;
}
.hello::-webkit-scrollbar-thumb:vertical {
  background-color: #c0cedc;
  border-radius: 6px;
  outline: 1px solid rgba($color: #ffffff, $alpha: 0);
  outline-offset: -2px;
  border: 1px solid rgba($color: #ffffff, $alpha: 0);
  color: #e9e9e9;
}
.hello::-webkit-scrollbar {
  width: 4px;
  height: 4px;
  border-radius: 10px;
}
.hello::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
  border-radius: 10px;
  background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0.44,rgb(60,186,146)),color-stop(0.72,rgb(253,187,45)),color-stop(0.86,rgb(253,187,45)));
  transition: 0.3s ease-in-out;
}
.hello::-webkit-scrollbar-track {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
}
.son{
  width: 400px;
  height: 400px;
}
<div class="hello">
   <div class="son"></div>
</div>

效果:

转载请注明出处或者链接地址:https://www.qianduange.cn//article/13445.html
标签
评论
发布的文章

读魏书生的心得体会

2024-07-03 14:07:10

jQuery 选择器

2024-05-12 00:05:34

Vue中public/assets目录区别

2024-07-02 23:07:29

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!