Hiding the scroll bar on an HTML page

前端 未结 21 1087
旧巷少年郎
旧巷少年郎 2020-11-22 00:07

Can CSS be used to hide the scroll bar? How would you do this?

21条回答
  •  逝去的感伤
    2020-11-22 00:50

    If you're looking for a solution to hide a scrollbar for mobile devices, follow Peter's answer!

    Here's a jsfiddle, which uses the solution below to hide a horizontal scrollbar.

    .scroll-wrapper{
        overflow-x: scroll;
    }
    .scroll-wrapper::-webkit-scrollbar { 
        display: none; 
    }
    

    It was tested on a Samsung tablet with Android 4.0.4 (Ice Cream Sandwich, both in the native browser and Chrome) and on an iPad with iOS 6 (both in Safari and Chrome).

提交回复
热议问题