CSS
设置全局的滚动条样式
- 效果图
- 只需要在全局的样式中添加,导入即可
::-webkit-scrollbar { width: 5px; /* 纵向滚动条*/ height: 5px; /* 横向滚动条 */ background-color: #fff; } /*定义滚动条轨道 内阴影*/ ::-webkit-scrollbar-track { box-shadow: inset 0 0 6px rgba(0, 0, 0, 0); background-color: #ccc; } /*定义滑块 内阴影*/ ::-webkit-scrollbar-thumb { box-shadow: inset 0 0 6px rgba(0, 0, 0, 0); background-color: #1890ff; border-radius: 10px; }