滚动条美化

225 阅读1分钟

1.Div

给div添加类名.scroller

// 滚动条美化

.scroller::-webkit-scrollbar {

width: 8px;

height: 8px;

}

.scroller::-webkit-scrollbar-track {

background-color:#F5F5F5;

-webkit-border-radius: 2em;

-moz-border-radius: 2em;

border-radius:2em;

}

.scroller::-webkit-scrollbar-thumb {

background-color:#c8c8c8;

-webkit-border-radius: 2em;

-moz-border-radius: 2em;

border-radius:2em;

}

2.el-table

::v-deep{

// 滚动条的宽度

.el-table__body-wrapper::-webkit-scrollbar {

width: 8px; // 横向滚动条

height: 8px; // 纵向滚动条 必写

}

// 滚动条的滑块

.el-table__body-wrapper::-webkit-scrollbar-thumb {

background-color: #ddd;

border-radius: 3px;

}