Force iPhone web app to landscape mode

tom barnes picture tom barnes · Mar 13, 2009 · Viewed 7.8k times · Source

How do you force an iPhone web app (not a native app) into landscape mode?

Answer

user141682 picture user141682 · May 26, 2010

I don't know how to force it on startup, but I found a neat way to make your content scale correctly when changing from Portrait to Landscape, especially if you're using canvas.

<head>
  <meta name="viewport" content="initial-scale=1.6; maximum-scale=1.0; width=device-width; "/>
  ...
</head>

So, as soon as your user flips the phone to landscape mode, your page will appear in the correct scale.