css - 自定义滚动条按钮
问题描述
但是,滚动条按钮看起来很难看。我正在尝试使按钮如下所示: 有人可以帮忙吗?我正在使用下面的 css 来自定义滚动条。
::-webkit-scrollbar {
width: 16px;
}
::-webkit-scrollbar-track {
background: rgb(224, 224, 224);
}
::-webkit-scrollbar-thumb {
background: rgb(200, 200, 200);
border: 0.05em solid #eeeeee;
}
::-webkit-scrollbar-thumb:hover {
background: rgb(180, 180, 180);
}
::-webkit-scrollbar-thumb:active {
background: rgb(117, 117, 117);
}
::-webkit-scrollbar-button {
border-style: solid;
height: 16px;
width: 16px;
}
::-webkit-scrollbar-button:vertical:decrement {
border-width: 0 7px 14px 7px;
border-color: transparent transparent rgb(117, 117, 117) transparent;
}
::-webkit-scrollbar-button:vertical:decrement:hover {
border-color: transparent transparent rgb(180, 180, 180) transparent;
}
::-webkit-scrollbar-button:vertical:increment {
border-width: 14px 7px 0 7px;
border-color: rgb(117, 117, 117) transparent transparent transparent;
}
::-webkit-scrollbar-button:vertical:increment:hover {
border-color: rgb(180, 180, 180) transparent transparent transparent;
}
解决方案
请在下面尝试
.scrollbar
{
margin-left: 30px;
float: left;
height: 300px;
width: 50px;
background: #F5F5F5;
overflow-y: scroll;
margin-bottom: 25px;
}
.overflow
{
min-height: 400px;
}
#wrapper
{
text-align: center;
width: 500px;
margin: auto;
}
#stylescroll::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
background-color: #F5F5F5;
}
#stylescroll::-webkit-scrollbar
{
width: 6px;
background-color: #F5F5F5;
}
#stylescroll::-webkit-scrollbar-thumb
{
background-color: #a6aebb;
}
<div id="wrapper">
<div class="scrollbar" id="stylescroll">
<div class="overflow"></div>
</div>
</div>
推荐阅读
- macos - ESP 寄存器取消引用分段错误,x86
- python - CSV - 如何逐行读写?
- react-native - 使用 axios meet 无限循环在 React Native 中获取数据
- node.js - 护照注册只是不断旋转
- reactjs - 在哪里初始化一个库反应(如角度服务)
- java - 它在另一个对象的创建中创建的类和对象的 UML 关系?
- node.js - Mongodb嵌套资源API
- r - 运行 weathercan 包时出错 - 致命 SSL/TLS 警报(例如握手失败))
- haskell - 为什么 Haskell 在这个例子中忽略了硬编码的 int?
- python-3.x - 合并由熊猫concat创建的重复列?