Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to fix Viewport issue when going from landscape to portrait

I've been doing some research about viewport issues in iPod and iPhone 4's Safari, but i can't find any answer on this matter. There are several threads about issues going from portrait to landscape, but not from landscape to portrait. The issue is the following:

I used to have the normal zooming issue when going from portrait to landscape so i added the tag:

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

So that fixed that issue. NOW, when I go back to portrait mode, the page I made gets streched and it renders with an added right margin. This makes the page wider, so you have to sweep to the left to get the original position of the page (thought it keeps the new 'right margin').

Sorry if there was someone that already answered this, but i just couldn't seem to find any response to this issue.

Let me know if some additional information is required. Please keep in mind it's my first question :/

Thank you!

EDIT: I'm running iOS 6, and getting this issue. When i run my page on an iOS 5.1.1 it displays properly, so it might be a new version of the viewport bug that was fixed before.

like image 603
Alfie Barboza Avatar asked Oct 26 '25 02:10

Alfie Barboza


1 Answers

I think you want to add this to your CSS or style block. (It was in this post)

  html {
      -webkit-text-size-adjust: none; /* Never autoresize text */
  }
like image 114
Mike M Avatar answered Oct 29 '25 07:10

Mike M