CSS改滚动条样式
CSS代码不怎么难,因此我不解释代码了。
具体代码如下:
::-webkit-scrollbar{ width:17px; height:0px; background:-webkit-gradient(linear,left top,right top,color-stop(0%,rgba(202,202,202,0.07)),color-stop(100%,rgba(229,229,229,0.07))); background:-webkit-linear-gradient(left,rgba(202,202,202,0.07) 0%,rgba(229,229,229,0.07) 100%); background-color:rgba(229,229,229,.3); -webkit-box-shadow:0 0 1px 0 rgba(0,0,0,.15) inset,0 1px 0 0 #fff; box-shadow:0 0 2px 0 rgba(0,0,0,.15) inset,0 1px 0 0 #fff; overflow:visible; border-radius:4px; border:solid 2px #A6A6A6; } ::-webkit-scrollbar-button{ width:0; height:0; display:block; background-color:transparent; } ::-webkit-scrollbar-thumb{ background:-webkit-gradient(linear,left top,right top,color-stop(0%,rgba(233,233,233,0.05)),color-stop(100%,rgba(221,221,221,0.05))); background:-webkit-linear-gradient(left,rgba(233,233,233,0.05) 0%,rgba(221,221,221,0.05) 100%); -webkit-box-shadow:0 2px 1px 0 rgba(0,0,0,.05),inset 1px 1px 0 0 #FFF; box-shadow:0 2px 1px 0 rgba(0,0,0,.05),inset 1px 1px 0 0 #FFF; background-color:rgba(229,229,229,.9); overflow:visible; border-radius:4px; border:solid 3px #A6A6A6; } ::-webkit-scrollbar-thumb:active{ background-color:rgba(229,229,229,1); -webkit-box-shadow:0 0 1px 0 rgba(0,0,0,.15) inset; box-shadow:0 0 2px 0 rgba(0,0,0,.15) inset; } ::-webkit-scrollbar-thumb:hover{ background-color:rgba(229,229,229,.4); } ::-webkit-scrollbar-corner {} ::-webkit-resizer {} ::-webkit-scrollbar-track {} ::-webkit-scrollbar-track-piece {}
注意:-webkit-是专门针对chrome和苹果浏览器Safari的,如果要针对Firefox和Opera分别应该加-moz-和-o-。学习css就是要不段地去试,最终才能达到好的样式。希望大家学有所长。
相关推荐
Ladyseven 2020-10-22
李鴻耀 2020-08-17
yaodilu 2020-08-03
jiedinghui 2020-10-25
zuncle 2020-09-28
xiaohuli 2020-09-02
葉無聞 2020-09-01
nicepainkiller 2020-08-20
AlisaClass 2020-08-09
myloveqiqi 2020-08-09
buttonChan 2020-08-02
drdrsky 2020-07-29
Ladyseven 2020-07-25
nicepainkiller 2020-07-24
AlisaClass 2020-07-19
hellowzm 2020-07-19
background-color: blue;background-color: yellow;<input type="button" value="变蓝" @click="changeColorT
昔人已老 2020-07-19
骆驼的自白 2020-07-18
lanzhusiyu 2020-07-19