Scrollbar thumb height in css

后端 未结 2 1234
清歌不尽
清歌不尽 2020-12-31 17:59

Is the height of scroll thumb set as default according to scroll-able area? If not, can I set scrollbar thumb height? If it is possible how? I tried to do it the following

相关标签:
2条回答
  • 2020-12-31 18:29

    If you want to set fixed min height to the scrollbar thumb even when scroll. we can set like below:

    ::-webkit-scrollbar-thumb {
        min-height: 40px;
       }
    
    0 讨论(0)
  • 2020-12-31 18:37

    I don't think so, the height of the thumb is based in the size of content, you can change the width inside the ::-webkit-scrollbar but the height will always be based on the content.

    ::-webkit-scrollbar              { /* 1 */ }
    ::-webkit-scrollbar-button       { /* 2 */ }
    ::-webkit-scrollbar-track        { /* 3 */ }
    ::-webkit-scrollbar-track-piece  { /* 4 */ }
    ::-webkit-scrollbar-thumb        { /* 5 */ }
    ::-webkit-scrollbar-corner       { /* 6 */ }
    ::-webkit-resizer                { /* 7 */ }
    

    Source

    0 讨论(0)
提交回复
热议问题