I believe this is a bug in Safari, but I figured out how to get around it. This is due to certain elements and their styles. As it was resolved, I narrowed it down to a few “offensive” HTML elements. Removing width: 100%; from some CSS elements and styles, as well as other static widths, such as width: 120px; will begin to reduce the problem. I say “start to decrease” because the margin on the right has become smaller, but has not completely disappeared. Then I started playing with other CSS attributes like margin and padding. After eliminating some left and right additions from some elements, the problem finally disappeared. But this was not entirely acceptable, as these styles were for some reason.
The solution was to wrap everything in a container element whose size matched and set overflow: hidden; in CSS. Setting overflow: hidden; body tags or html will work too, but it did funky vertical scrolling in Mobile Safari. In my case, there was already such a container element, so all I had to do was add the overflow property to it.
As I said, I think this is a bug in Safari. When turning from Landscape to portrait, everything should be changed in accordance with the portrait orientation mode. Visually, everything looks as if it was changed correctly. However, Safari must have thought that something had not been changed correctly, so it showed the page wider than it actually was. This works great in Chrome on an Android device. I also added various background colors and borders to highlight which element can cause the page to stretch beyond the width of the device’s screen. Visually, there was no clear culprit.
If you think this could be a width: 100% plus padding problem, I had the same thought. But when removing either the width or the field / stock separately, a problem that it was not had to be fixed. Not a single item sat at the edge of the screen. There was an empty place.
source share