Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 251
zarinf Avatar asked Jun 22 '12 23:06

zarinf


People also ask

Why is my iPad stuck zoomed in?

Try to force restart the device to fix it. Press and quickly release the volume up button, press and quickly release the volume down button, then press and hold the top button and keep it pressed until Apple logo appears, release the button and your iPad will finish booting up.

How do I Unzoom my iPhone accessibility?

Turn off Zoom in Settings on your device If you can't access Settings because your Home screen icons are magnified, double tap with three fingers on the display to zoom out. To turn off Zoom, go to Settings > Accessibility > Zoom, then tap to turn Zoom off.


2 Answers

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"> 
like image 55
justinavery Avatar answered Sep 25 '22 12:09

justinavery


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

like image 23
minneapolisdan Avatar answered Sep 23 '22 12:09

minneapolisdan