Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css hide scrollbar?

Tags:

css

I am wanting to have a div area scrollable on my page and have set the overflow on my div CSS to scrollable but now I want to hide the scrollbar in all browsers, so the div can scroll without the scrollbar/panel displaying, including hiding that awful scroll panel in Firefox, I know how to hide the scrollbar in chrome but this doesn't work in firefox, can anyone suggest anything thanks?

here's what i'm using to hide the scrollbar in chrome and other webkit browsers:

#element::-webkit-scrollbar { 
    display: none; 
}
like image 302
Bear John Avatar asked Oct 22 '22 12:10

Bear John


2 Answers

Not pure CSS (since you have to add an extra element) but how about making your div a bit wider and then wrapping it in another div with overflow:hidden?

The inner div would still scroll but the scroll bar would be outside the margins of the outer div, so they would not be visible.

like image 148
cockypup Avatar answered Oct 30 '22 16:10

cockypup


i found someone gives that answer:

.noscrollbar{
  -ms-overflow-style:none;
  overflow:-moz-scrollbars-none;// but it seems to not work...
}
.noscrollbar::-webkit-scrollbar{width:0px}
like image 45
chendind Avatar answered Oct 30 '22 14:10

chendind