在vue项目中修改全局滚动条样式
# 在 base.css 中加入该样式
# 一、样式一【推荐】
box-shadow 方式
::-webkit-scrollbar { | |
width: 8px; | |
height: 6px; | |
} | |
::-webkit-scrollbar-thumb { | |
border: 1px solid rgb(0 0 0 / 0%); | |
border-radius: 10px; | |
box-shadow: 6px 0 0 #e3e3e3 inset; | |
} | |
::-webkit-scrollbar-thumb:hover { | |
box-shadow: 6px 0 0 #e3e3e3 inset; | |
} |
# 二、样式二
::-webkit-scrollbar { | |
width: 6px; | |
height: 6px; | |
} | |
::-webkit-scrollbar-track { | |
background: none; | |
/* background: rgb(239, 239, 239); */ | |
} | |
::-webkit-scrollbar-thumb { | |
background: #999999; /* #bfbfbf */ | |
border-radius: 10px; | |
} |
# 三、样式三
/* 全局滚动条样式 */ | |
::-webkit-scrollbar { | |
width: 5px; | |
height: 14px; | |
} | |
::-webkit-scrollbar-thumb { | |
/* background-color: #01c8dc; | |
border-radius: 3px; */ | |
background-color: #b6b6b6; | |
} | |
/* 全局滚动条样式结束 */ |










