Viewport meta tag not working in iPhone and Android Viewport meta tag not working in iPhone and Android android android

Viewport meta tag not working in iPhone and 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 !


Put this script to avoid pinch zoom. in latest version of safari, if meta tag not working

   document.documentElement.addEventListener('touchstart', function(event) {     if (event.touches.length > 1) {       event.preventDefault();     }   }, false);