0

I know it is repetitive question but problem remained unsolved tried various approaches show in various sites but in chrome the scroll bar is hiding and it is working fine but in Mozilla Firefox it is displaying the scroll bar even i applied the hidden properties for -moz.

below is my code :

.scroll-box {
    overflow-y: scroll;
    height: 100px;
    padding: 1rem;
    overflow-x: hidden;
}

// this is for google
.scroll-box::-webkit-scrollbar {
    display: none;
}

for Firefox i tried this from documentation then also it is displaying the scroll bar

overflow-y: -moz-hidden-hidden

below is the url sample:

https://stackblitz.com/edit/angular-usy73w

Scroll bar displaying in firefox

Krupesh Kotecha
  • 2,396
  • 3
  • 21
  • 40
Devpop
  • 37
  • 1
  • 10

2 Answers2

0

I have tried the code IN FIREFOX and it works. (The code is the one you have provided).

Perhaps, try resetting your browser settings on firefox and see if that helps.

Also, I believe you are trying to hide the horizontal scrollbar. If that is not the case, and you are trying to hide the vertical scrollbar, then simply switch the overflow x and y properties.

-1

I've tested the code in codepen and it works as expected.

Edited after further investigation: First off, I'm not entirely sure what you are trying to hide, the horizontal scrollbar, the vertical scrollbar, or both.

If you want to hide both, overflow:hidden should do the trick. I've interpreted your question as wanting to hide the vertical scrollbar. In this case, it is actually working properly in Firefox (based on your code) and is hiding in Chrome because of your -webkit-scrollbar css property.

Stefan Morris
  • 165
  • 1
  • 11
  • have you tested the code bcoz it is still showing the scrollbar in the firefox please once check – Devpop Jul 10 '18 at 04:12
  • I have updated the pen to have a wider child div and confirmed in Firefox and Chrome that only the vertical scrollbar is showing. What version of FF are you using? – Stefan Morris Jul 10 '18 at 04:15
  • i am using firefox 61 version and vertical scrollbar only it doesnt have to show – Devpop Jul 10 '18 at 04:16