Responsive site is zoomed in when flipping between Portrait and Landscape on iPad/iPhone

OrientationResponsive DesignViewportScreen OrientationDevice Orientation

Orientation Problem Overview


I've built a responsive site using Twitter Bootstrap here: http://zarin.me/cce/

The responsive design works great on iPad and iPhone, however when I flip the device from portrait to landscape, the site is zoomed in instead of adapting to the screen (pinching the screen works).

What am I missing? Is this a viewport issue? Here's the only viewport code I have in my :

<meta content="width=device-width, initial-scale=1.0" name="viewport">

Thanks in advance!

Orientation Solutions


Solution 1 - Orientation

You also want to add the maximum scale

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

UPDATED I agree with some of the comments, the declaration should not limit the scaling by the user as this is bad practice. The below is a better approach and I believe that the zooming bug has long since been fixed by Apple.

<meta name="viewport" content="width=device-width, initial-scale=1">

Solution 2 - Orientation

While setting the maximum scale to "1" does work, it restricts your users from zooming in on anything within your site. Not ideal for user experience. Try this Javascript instead, iOS-Orientation Change Fix

Solution 3 - Orientation

Set initial-scale=1.0 in the meta:

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

Then set -webkit-text-size-adjust:100%; in the CSS:

body {
  -webkit-text-size-adjust: 100%;
}

This approach doesn't stop a user from zooming in on your website but will ensure that the text doesn't get size adjusted automatically by the browser.

Solution 4 - Orientation

I've seen this happening when one of the containers on the page spills past 100%. The page displays ok in the initial orientation, but when the orientation is changed the extra width somehow becomes in force, causing the page to scale in, and usually leaves a margin on the right or left. Worth checking all your media queries to make sure there is not some trailing padding or margin.

Solution 5 - Orientation

The following works for me and allows users to zoom in

<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />

Solution 6 - Orientation

Had exactly this issue on Ipad 3 and IOS 7.1.2

Using maximum-scale=1 fixed it and allows zoom

The js solution did not work

Solution 7 - Orientation

If you are facing issue mainly in iPhone-X try <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover" />

That's work for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionzarinfView Question on Stackoverflow
Solution 1 - OrientationjustinaveryView Answer on Stackoverflow
Solution 2 - OrientationminneapolisdanView Answer on Stackoverflow
Solution 3 - OrientationLeigh McCullochView Answer on Stackoverflow
Solution 4 - Orientationuser1199529View Answer on Stackoverflow
Solution 5 - OrientationjjgraingerView Answer on Stackoverflow
Solution 6 - OrientationDavid SimsView Answer on Stackoverflow
Solution 7 - OrientationAmit DwivediView Answer on Stackoverflow