2

When the body element has style 'overflow: hidden', it automatically removes the scrollbar because it's no longer needed (because of the overflow hidden).

This removes the 15 pixels of spacing to the right (which is only there because of the scrollbar).

This also causes the browser to shift by 15 pixels.

Is there a way to avoid this?

I know I can just add a 15 pixels spacing to the right, but some browsers have a scroll bar that just hovers over the browser and I don't want a 15 pixels spacing to be there in that case.

TLS
  • 3,090
  • 2
  • 25
  • 33
Mcope
  • 781
  • 8
  • 22
  • Does [this answer](http://stackoverflow.com/a/12582621/475820) do what you want? It talks about always showing the vertical scrollbar. – TLS Feb 13 '15 at 04:00
  • You can use custom scroll script to avoid this. "nicescroll" is good option. – PRAH Feb 13 '15 at 04:08

0 Answers0