Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you disable viewport zooming on Mobile Safari?

I've tried all three of these to no avail:

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

each are different values I found recommended by google searching or SO searching, but none of the 'user-scalable=X' values seem to be working

I also tried comma delimiting the values instead of semicolon, no luck. Then I tried ONLY having the user-scalable value present, still no luck.


UPDATE

Got this from Apple's site and it works:

<meta name="viewport" content="width=device-width, user-scalable=no" /> 

it turns out that the problem was the non-standard quotes because I had copied the meta tag from a website that was using them, whoops

like image 367
MetaGuru Avatar asked Dec 08 '10 16:12

MetaGuru


People also ask

How do I turn off zoom in Safari?

In the Safari app on your Mac, choose Safari > Preferences, click Websites, then click Page Zoom. Select all websites listed under Configured Websites, then click Remove to clear the list.

How do I turn off viewport scaling?

To disable pinch-zoom in HTML, simply add <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> to the <head> section.

How do I stop my iPhone from zooming in input focus?

If you enlarge the field by increasing all dimensions by 16 / 12 = 133.33%, then reduce using scale() by 12 / 16 = 75%, the input field will have the correct visual size (and font size), and there will be no zoom on focus.

How do I turn off zoom on my phone?

We can use the <meta> tag to disable zoom in and out on a mobile web page.


1 Answers

Your code is displaying attribute double quotes as fancy double quotes. If the fancy quotes are present in your actual source code I would guess that is the problem.

This works for me on Mobile Safari in iOS 4.2.

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> 
like image 81
BoltClock Avatar answered Sep 22 '22 07:09

BoltClock