How to enable pinch zoom on website for mobile devices?

Posted December 13, 2016 35.4k views

Pinch zoom is a key feature of mobile browsing, which allow you to to zoom in to read content and out to locate content within a page. I am trying to enable this feature on my website. I’ve tried to enable zooming by setting meta viewport like this.

<meta name=“viewport” content=“width=device-width,initial-scale=1”>

It’s working on my android smartphone(Sony) but it’s not zoomable on iPad and iPhone. My site is a php site, design in HTML5. Is this a designing issue or error in above mentioned code.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

The viewport meta tag has some other parameters that when added may solve the issue with zooming on iOS. Here’s an example:

<meta name="viewport" content="width=device-width, initial-scale=.5, maximum-scale=12.0, minimum-scale=.25, user-scalable=yes"/>

user-scalable looks to be the main parameter you’re missing that should make the difference.

Thanks for the response, i will replace my code with yours and let you know the effect.