CSS vertical scrollbar padding left/right in UL possible?

后端 未结 5 988
[愿得一人]
[愿得一人] 2020-12-13 06:39

Is it possible to add padding or margin around the scrollbar item or scrollbar-track? I\'ve tried and can only get padding top/bottom. Adding padding to the UL has no effe

5条回答
  •  北海茫月
    2020-12-13 07:22

    You can see an example over there (http://jsfiddle.net/6KprJ/1/), basically forget adding margin or padding there, just increase the width/height of scroll area, and decrease the width height of thumb/track.

    Quoted from how to customise custom scroll?

    ::-webkit-scrollbar {
        width: 14px;
        height: 18px;
    }
    ::-webkit-scrollbar-thumb {
        height: 6px;
        border: 4px solid rgba(0, 0, 0, 0);
        background-clip: padding-box;
        -webkit-border-radius: 7px;
        background-color: rgba(0, 0, 0, 0.15);
        -webkit-box-shadow: inset -1px -1px 0px rgba(0, 0, 0, 0.05), inset 1px 1px 0px rgba(0, 0, 0, 0.05);
    }
    ::-webkit-scrollbar-button {
        width: 0;
        height: 0;
        display: none;
    }
    ::-webkit-scrollbar-corner {
        background-color: transparent;
    }
    

提交回复
热议问题