iPhone Safari does not auto scale back down on portrait->landscape->portrait

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-04-06T00:30:34Z Indexed on 2010/04/06 0:33 UTC
Read the original article Hit count: 578

Filed under:

Hi, I have a very simple HTML page with this META tag for the iPhone:

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

When the page loads in portrait mode it looks fine and the width fits the screen. When I rotate the iPhone to landscape mode the web page is auto resized to fit the landscape width. Good, this is what I want.

But when I rotate back to landscape, the page is not resized back to fit the portrait width like it was before. It remains in the landscape width.

I want the iPhone to set it back to the right width automatically, just like it did for the landscape mode. I don't think this should involve orientation listeners because it is all done automatically and I don't have any special styling for the different modes.

Why doesn't the iPhone resize the web page back in portrait mode? How do I fix this? Thanks! Tom.

© Stack Overflow or respective owner

Related posts about iphone