效果1.
代码:
.on-live {
width : 100%;
background-color: #fff;
height : 360px;
margin: 23px 0 20px 0;
overflow-y: auto;
&::-webkit-scrollbar {
overflow: visible;
width: 13px;
}
/*定义滚动条滑块*/
&::-webkit-scrollbar-thumb {
background-color: #92BEFF;
min-height: 15px;
}
/*定义滚动条的轨道颜色、内阴影及圆角*/
&::-webkit-scrollbar-track{
background-color: #EFF6FF;
}
/*定义两端按钮的样式*/
&::-webkit-scrollbar-button:vertical:start {
background-color:#EFF6FF;
background-image : url("../../../../../ydjy/liveshow-icon.png");
width : 11px;
height : 11px;
display : inline-block;
background-repeat: no-repeat;
background-position: -105px -15px;
}
&::-webkit-scrollbar-button:vertical:end {
background-color:#EFF6FF;
background-image : url("../../../../../ydjy/liveshow-icon.png");
width : 11px;
height : 11px;
display : inline-block;
background-repeat: no-repeat;
background-position: -105px -74px;
}
}
效果2:
代码:
//mixin方法,可多处使用
@mixin scrollbar($width, $border-radius) {
overflow-y: auto;
&::-webkit-scrollbar {
width: $width;
}
&::-webkit-scrollbar-thumb {
border-radius: $border-radius;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #B9BAC9;
}
&::-webkit-scrollbar-track {
box-shadow: unset;
background: #5E5D6E;
border-radius: $border-radius;
}
@media screen and (min--moz-device-pixel-ratio:0) {
scrollbar-width: thin;
}
}