Quantcast
Channel: Eureka! » iPhone
Viewing all articles
Browse latest Browse all 10

HTML – Disable auto scaling on iPhone Safari when switching from portrait to landscape

$
0
0

For iPhone users, when you are viewing a website on Safari and switch the screen orientation from portrait to landscape, you will find that the content of the page will be scaled automatically to fit the screen width. This maybe a nice feature but probably not good for responsive design.

To disable the auto scaling, you can add the following meta on your HTML inside the <head> tag.

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0" />

 

A drawback is the above meta will disable the user scaling as well. For more information, please refer to the reference link below.

Done =)

Reference: StackOverflow – How can I disable MobileSafari’s content scalling on orientation change?


Filed under: HTML, iPhone Tagged: HTML, iPhone, Safari

Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images