Prabhat Prabhat - 4 years ago 162
Android Question

Viewport meta tag not working in iPhone and Android

I am using the following html code

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

My intention is to prevent user from zooming in or out. The above code isn't working in iPhone and Android. Any solution ?

EDIT: It appears in iPhone settings, if
is selected as
, then this will override meta tag. Source

Not sure why it is happening in android.

Answer Source

I use this tag to prevent zoom on all mobile platforms :

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no; target-densityDpi=device-dpi" />

With ; and not ,

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download