5

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; 
}

3 Answers 3

1

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.

1
  • Not sure it is compatible across different browsers, scrollbars might have different widths and this might result in content being cut. Chrome for Android, as far as I know, doesn't have scrollbars at all. It does display a progress indicator during drag, but no scrollbar. That is, I'd say it's a bad practice.
    – D-side
    Commented Nov 28, 2013 at 17:52
1

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}
1
  • 1
    Hello, instead of just posting it would be better to explain what it does.
    – AFract
    Commented Sep 14, 2015 at 9:25
1

This has worked for me

::-webkit-scrollbar {
      width: 0 !important;
   }
-ms-overflow-style: none;

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.