I am using the following html code
<!DOCTYPE HTML>
<html>
<head>
<title>test</title>
<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"/>
</head>
<body>
test
</body>
</html>
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 Zoom
is selected as On
under Settings>Accessibility>Zoom
, then this will override meta tag. Source
Not sure why it is happening in android.
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 ;
In my part, I've this "viewport" which work good on an Android (Nexus 5) and on iPhone.
<meta name="viewport" content="width=device-width; initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5; " />
I hope this help you !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With