D
D
Dmitry2015-02-26 20:27:07
iPhone
Dmitry, 2015-02-26 20:27:07

Horizontal scrolling on iphone?

I register
but the site on an iPhone in portrait mode can still move horizontally and see a white background on the sides. How to fix it so that the site scrolls only vertically?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan K, 2019-12-09
@ikonkov

The question is old, but there is no answer, but in Google in the first place. That's why I'll answer =)
So that on iPhones / iPads it doesn't scroll sideways, you need to set position: relative to html, body;

html, body { 
    position: relative;
    max-width: 100%; 
    overflow-x: hidden; 
}

A
Andrey Surzhikov, 2015-03-05
@Surzhikov

Check if there are elements that fit in width (greater than viewport)
Well,

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0"/>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question