Disable zoom/scrolling on mobile and tablet?

Hi there,

I have a page that is becoming a nuisance on mobile. I have an element that requires to be placed off the page for an animation.

However, the page can be zoomed out and looks like this on a mobile device:

Is there a way to stop the user zooming out/scrolling horizontally on mobile devices?

I have tried the following, but it doesn’t do anything:

body{
	overflow:hidden;
    width:100%;
    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
            box-sizing: border-box;
}

Any suggestions would be great!

I think we’d need to see a demo to debug properly but I don’t believe you can hide the overflow on the body element on mobile.

Try using an wrapper div and hide the overflow on that instead.

1 Like