开发指南107-谷歌内核浏览器滚动条设置

平台上统一制定了滚动条样式(仅限于webkit内核):

/* ------美化谷歌浏览器滚动条  开始-----------*/

::-webkit-scrollbar{width:12px;height:12px;background-color: #E1E1E1;}

::-webkit-scrollbar-button:single-button {

    background-color:#E1E1E1;

    display: block;

    background-size: 10px;

    background-repeat: no-repeat;

}

::-webkit-scrollbar-button:single-button:vertical:decrement {

    height: 12px;

    width: 12px;

    background-position: center 4px;

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(96, 96, 96)'><polygon points='50,00 0,50 100,50'/></svg>");

}

::-webkit-scrollbar-button:single-button:vertical:decrement:hover {

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(112, 112, 112)'><polygon points='50,00 0,50 100,50'/></svg>");

}

::-webkit-scrollbar-button:single-button:vertical:decrement:active {

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(128, 128, 128)'><polygon points='50,00 0,50 100,50'/></svg>");

}

::-webkit-scrollbar-button:single-button:vertical:increment {

    height: 12px;

    width: 12px;

    background-position: center 2px;

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(96, 96, 96)'><polygon points='0,0 100,0 50,50'/></svg>");

}

::-webkit-scrollbar-button:single-button:vertical:increment:hover {

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(112, 112, 112)'><polygon points='0,0 100,0 50,50'/></svg>");

}

::-webkit-scrollbar-button:single-button:vertical:increment:active {

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(128, 128, 128)'><polygon points='0,0 100,0 50,50'/></svg>");

}

::-webkit-scrollbar-button:single-button:horizontal:decrement {

    height: 12px;

    width: 12px;

    background-position: 3px 3px;

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(96, 96, 96)'><polygon points='0,50 50,100 50,0'/></svg>");

}

::-webkit-scrollbar-button:single-button:horizontal:decrement:hover {

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(112, 112, 112)'><polygon points='0,50 50,100 50,0'/></svg>");

}

::-webkit-scrollbar-button:single-button:horizontal:decrement:active {

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(128, 128, 128)'><polygon points='0,50 50,100 50,0'/></svg>");

}

::-webkit-scrollbar-button:single-button:horizontal:increment {

    height: 12px;

    width: 12px;

    background-position: 3px 3px;

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(96, 96, 96)'><polygon points='0,0 0,100 50,50'/></svg>");

}

::-webkit-scrollbar-button:single-button:horizontal:increment:hover {

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(112, 112, 112)'><polygon points='0,0 0,100 50,50'/></svg>");

}

::-webkit-scrollbar-button:single-button:horizontal:increment:active {

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='rgb(128, 128, 128)'><polygon points='0,0 0,100 50,50'/></svg>");

}

::-webkit-scrollbar-track{

    background-color: #E1E1E1;

}

::-webkit-scrollbar-track-piece{background-color:#E1E1E1;}

::-webkit-scrollbar-thumb{background-color:#B4B4B4;border-radius:6px}

::-webkit-scrollbar-thumb:hover{background-color:#858585;}

::-webkit-scrollbar-corner{background-color:#E1E1E1}

/*---------- 美化谷歌浏览器滚动条  结束-----------*/

其中最复杂的部分是定义滚动条两端的箭头

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大道不孤,众行致远

请给我加油

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值