Home > Software design >  How do I hide horizontal scroll bar and keep vertical scroll bar visible while still being able to s
How do I hide horizontal scroll bar and keep vertical scroll bar visible while still being able to s

Time:11-25

There are a lot of such questions but I haven't been able to find one which answers how to remove only the horizontal scroll bar while still being able to scroll horizontally:

I used the following code, but it removed both the horizontal and vertical scroll bars:

.section {
  overflow-y: auto;
  scrollbar-width: none; /*For firefox*/
}

::-webkit-scrollbar {
  display: none; /*For remainder of the browsers*/
} 


CodePudding user response:

Try this:

.section {
  overflow-x: scroll;
  scrollbar-width: none;
  overflow-y: auto;
}

.section::-webkit-scrollbar {
  display: none;
}
  • Related