纯css实现漂亮的滚动条样式,X轴、Y轴;横向、纵向@[TOC](纯css 实现漂亮的滚动条样式–变化⾊)
<div class="leaseRoomList test-1">
<ul>
<li >
</li>
</ul>
<p class="listOver">到底啦~</p>
</div>
<!--css-->
.leaseRoomList {
height:490px;
overflow-y: auto;
margin:5px 006px;
overflow-x: hidden;
}
.test-1::-webkit-scrollbar {
/*滚动条整体样式*/
width:8px;/*⾼宽分别对应横竖滚动条的尺⼨*/
height:1px;
}
.test-1::-webkit-scrollbar-thumb {
/*滚动条⾥⾯⼩⽅块--纯⾊*/
/
*border-radius: 10px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: rgba(23,161,230,1);*/
/*滚动条⾥⾯⼩⽅块--变化⾊*/
border-radius:8px;
background-color: skyblue;
background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.2)25%, transparent 25%, transparent 50%,rgba(255,255,255,0.2)50%,rgb a(255,255,255,0.2)75%, transparent 75%, transparent );
}
.test-1::-webkit-scrollbar-track {
/*滚动条⾥⾯轨道*/
box-shadow: inset 005px rgba(0,0,0,0.2);
border-radius:10px;
background: #ededed;
}
<div class="leaseRoomList test-2">
<ul>
<li >
</li>
</ul>
<p class="listOver">到底啦~</p>
</div>
.
test-2::-webkit-scrollbar {
/*滚动条整体样式*/
width:1px;/*⾼宽分别对应横竖滚动条的尺⼨*/
height:8px;
}
.test-2::-webkit-scrollbar-thumb {
/*滚动条⾥⾯⼩⽅块*/
/*border-radius: 10px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: rgba(23,161,230,1);*/
/*滚动条⾥⾯⼩⽅块*/
border-radius:8px;
background: #1F76FF;
/*background-color: skyblue;*/
/*background-image: -webkit-linear-gradient( 45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rg ba(255, 255, 255, 0.2) 75%, transparent 75%, transparent );*/
}
.test-2::-webkit-scrollbar-track {
borderbox/*滚动条⾥⾯轨道*/
box-shadow: inset 005px rgba(0,0,0,0.2);
border-radius:10px;
background: #ededed;
}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。