Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable horizontal scroll on mobile web

I'm having an issue where horizontal scrolls appear on certain phones for my site. I tried to put overflow-x: hidden but it's not working. The width is auto, so that it will actually automatically resize the web to suits the screen size. All other phones are fine except when viewed in blackberry, nokia e52, and Windows mobile, the horizontal scroll will appear.

Any advice?

like image 483
Sylph Avatar asked Nov 16 '10 08:11

Sylph


People also ask

How do I stop my web page from scrolling horizontally on my phone?

In some instances, using overflow: hidden; will lock your page at the top, with no ability to scroll down. As Mikeys4u relates, it's usually better to use overflow-x: hidden; .

How do I stop horizontal scrolling on web pages?

To hide the horizontal scrollbar and prevent horizontal scrolling, use overflow-x: hidden: HTML.

Why is there horizontal scroll on mobile?

It is designed to allow space for secondary information, that doesn't hog page space. For example when displaying images in a photo gallery, horizontal scrolling lets users see a small sample of the content and gives them the option to quickly 'swipe' or click for more.

How do I remove horizontal scroll from Wordpress mobile?

The horizontal scrollbar issue on mobile devices can be fixed by setting overflow to hidden. You can do this by using the Elementor Section settings or by adding CSS code.


1 Answers

Simply add this CSS:

html, body {   overflow-x: hidden; } body {   position: relative } 
like image 57
pollux1er Avatar answered Sep 22 '22 02:09

pollux1er