修改滚动条样式
给一个 div 设置
.orgs-container {
max-height: 378px;
height: 378px;
overflow-y: auto;
}
Mac 上面 的滚动条样式为
修改样式
.orgs-container::-webkit-scrollbar { /*滚动条整体样式*/
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
height: 1px;
}
.orgs-container::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
border-radius: 10px;
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
background: #ebebeb;
}
.orgs-container::-webkit-scrollbar-track { /*滚动条里面轨道*/
/* -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2); */
border-radius: 10px;
background: #fff;
}
相关 HTML 代码如下,仅为记录类的层级关系
<div class="orgs-container">
<div>
<span>11111111</span>
</div>
<div>
<span>11111111</span>
</div>
<div>
<span>11111111</span>
</div>
<div>
<span>11111111</span>
</div>
<div>
<span>11111111</span>
</div>
<div>
<span>11111111</span>
</div>
<div>
<span>11111111</span>
</div>
<div>
<span>11111111</span>
</div>
<div>
<span>11111111</span>
</div>
<div>
<span>11111111</span>
</div>
<div>
<span>11111111</span>
</div>
</div>
来源:CSDN
作者:momomomomm
链接:https://blog.csdn.net/momomomomm/article/details/103991102