Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide horizontal scrollbar but still able to scroll

Tags:

html

css

I have a div with 3 div where every div scroll independently.

<div class="divWrapper">
  <div class="item"></div>
  <div class="item"></div>
  <div class="item"></div>
</div>

.item {
  position: relative;
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;
  overflow-x: auto;
  white-space: nowrap;
  box-sizing: border-box;
  padding: 0 16px;
  font-size: 0;
}

While scrolling i want to hide the scroll bar. on Windows all browser don't show scrollbar but on MAC scrollbar is visible. Is there a way to get scrolling without having the scrollbar visible?

like image 213
User1979 Avatar asked Oct 27 '25 15:10

User1979


2 Answers

Custom scrollbar in Webkit browsers


So the CSS is
::-webkit-scrollbar {
    display: none;
}

More at this topic: https://css-tricks.com/custom-scrollbars-in-webkit/

like image 129
undefined Avatar answered Oct 29 '25 04:10

undefined


use CSS code below

.row-cards  {
    display: flex;   
    overflow-y: hidden;
    overflow-x: scroll;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    
   

  }

This div class name is .row-cards for this the horizontal scroll bar functions would be active but the scroll bar would be hidden allowing for a smooth look and feel

like image 43
Fillz Adebayo Avatar answered Oct 29 '25 03:10

Fillz Adebayo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!