<!-- 效果如下图 -->
<style type="text/css">
.box {
padding: 100px 0;
width: 400px;
height: 300px;
overflow: scroll;
border: 1px solid red;
}
.content {
width: 100%;
height: 900px;
background-color: #ccc;
}
::-webkit-scrollbar { /* 血槽宽度 */
width: 10px;
height: 8px;
}
::-webkit-scrollbar-thumb { /* 拖动条 */
background-color: #B0ADC8;
border-radius: 6px;
}
::-webkit-scrollbar-track { /* 背景槽 */
background-color: #eee;
border-radius: 6px;
}
</style>
<div class="box">
<div class="content">content</div>
</div>
修改滚动条默认样式
最新推荐文章于 2023-03-07 14:32:45 发布