-1

While working on a web project, I suddenly noticed a random horizontal scroll pop-up near the banner area. I tried checking on the dev tools to see what was causing it but I couldn't find any lead. As you can see in image 1, the horizontal scroll pops up, but once you scroll down just a little bit. It starts to disappear (seen on image 2).

I hope someone can help me with this. This site needs to get deployed soon as it has a deadline.

image 2 image 1

fael_
  • 35
  • 1
  • 8

2 Answers2

2

While disabling the horizontal scroll is quite easy to implement, it is not recommended to use overflow-x: hidden;.

There is always a reason to why the site shows a horizontal scrollbar. I'd suggest finding out what exactly causes that behavior and rather fix it properly than trying to "hack" your way around it by disabling horizontal scrolling in itself.

Nathan
  • 2,699
  • 5
  • 30
  • 44
Pascal Stockert
  • 356
  • 1
  • 12
1

You can simply add overflow-x:hidden using css but I must say it is not a good way of implementing it. There is a reason browsers has horizontal scroll.

So I suggest to find out the issue in your code, probably there should have a min-width or a fixed width in some element which cause to show a horizontal stroller in smaller device width.

So go to inspect elements and delete each of the wrappers one by one until you get the horizontal stroller disappear. This is the easiest way I follow to find the element which has the issue.

SahanSira
  • 34
  • 6