CSS hide scroll bar, but have element scrollable

前端 未结 8 1531
南旧
南旧 2021-01-30 03:46

I have this element called items and the content inside the element is longer than the element height, I want to make it scrollable but hide the scroll bar, how would I do that?

相关标签:
8条回答
  • 2021-01-30 04:43

    if you use sass, you can try this

    &::-webkit-scrollbar { 
    
    }
    
    0 讨论(0)
  • 2021-01-30 04:44

    You can hide it :

    html {
      overflow:   scroll;
    }
    ::-webkit-scrollbar {
        width: 0px;
        background: transparent; /* make scrollbar transparent */
    }
    

    For further information, see : Hide scroll bar, but while still being able to scroll

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