I want to be able to scroll through the whole page, but without the scrollbar being shown.
In Google Chrome it's:
::-webkit-scrollbar {
display: none;
}
But Mozilla Firefox and Internet Explorer don't seem to work like that.
I also tried this in CSS:
overflow: hidden;
That does hide the scrollbar, but I can't scroll anymore.
Is there any way I can remove the scrollbar while still being able to scroll the whole page? With just CSS or HTML, please.
Here's another way that hasn't been mentioned yet. It's really simple and only involves two divs and CSS. No JavaScript or proprietary CSS is needed and it works in all browsers. It doesn't require explicitly setting the width of the container either thus making it fluid.
This method uses negative margin to move the scrollbar out of the parent and then the same amount of padding to push the content back to its original position. The technique works for vertical, horizontal and two way scrolling.
Demos:
Example code for the vertical version:
HTML:
CSS:
This Answer doesn't include the code, so here is the solution from page:
According to the page this approach doesn't need to know the width of the scrollbar ahead of time in order to work and the solution works for all browsers too, and can be seen here.
The good thing is that you are not forced to use padding or width differences to hide the scrollbar.
This is also zoom safe. Padding/width solutions show the scrollbar when zoomed to minimum.
FF fix: http://jsbin.com/mugiqoveko/1/edit?output
On modern browsers you can use
wheel event
https://developer.mozilla.org/en-US/docs/Web/Events/wheelI happen to try the above solutions in my project and for some reason I was not able to hide the scroll bar due to div positioning. Hence, I decided to hide the scroll bar by introducing a div that covers it superficially. Example below is for a horizontal scroll bar:
Corresponding CSS is as follows:
this is a trick to somewhat overlap scrollbar with an overlapping div which doesnt have any scroll bars
this is only for webkit browsers.. or you could use browser specific css (if there is any in future) every browser could have a different and specific property for their respective bars
--EDIT--
For Microsoft Edge use:
-ms-overflow-style: -ms-autohiding-scrollbar;
or-ms-overflow-style: none;
as per MSDN.There is no equivalent for FF Although there is JQuery plugin to achieve this http://manos.malihu.gr/tuts/jquery_custom_scrollbar.html
Just use following 3 lines and your problem will be solved :
Where liaddshape is the name of div where scrool is comming.