How do you disable viewport zooming on Mobile Safari?
Edit: may not work after iOS 10, please see touch-action
based solution below.
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" />
I have a mobile website but it loads zoomed out. How can I fix this?
You should insert the Viewport meta tag.
<meta name="viewport" content="width=device-width, initial-scale=1">
This means that the browser will (probably) render the width of the
page at the width of its own screen. So if that screen is 320px wide,
the browser window will be 320px wide, rather than way zoomed out and
showing 960px (or whatever that device does by default, in lieu of a
responsive meta tag).
Reference: Css-Tricks - Responsive Meta Tag - MDN - Using the viewport meta tag to control layout on mobile browsers
The values of meta viewport attribute are not reflected when in full screen mode in android chrome browser
I was able to go fullscreen by an alternative method using the web app manifest. It does not interfere with the meta viewport.
Here are the steps
- Add this to the head section:
<link rel="manifest" href="/manifest.json">
- Create a manifest file like the following:
{
"short_name": "App Name",
"name": "Full app name",
"icons": [
{
"src": "launcher-icon-4x.png",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "/index.html",
"display": "fullscreen",
"orientation": "landscape"
}
The Google developers documentation to launch in fullscreen using a manifest is available here.
The issue of fullscreen disabling the metaview port is raised here.
Disable Zoom on mobile devices
Your code is ok, the problem is iOS specific. Quoted from another question here on stackoverflow:
For the people looking for an iOS 10 solution, user-scaleable=no is
disabled in Safari for iOS 10. The reason is that Apple is trying to
improve accessibility by allowing people to zoom on web pages.
See the whole thread here:
How do you disable viewport zooming on Mobile Safari?
Or this one:
disable viewport zooming iOS 10 safari?
Related Topics
Extending Application to Share Variables Globally
How Does Push Notification Technology Work on Android
Mediacodec and Camera: Colorspaces Don't Match
How to Make Alarm Manager Work When Android 6.0 in Doze Mode
Why Is Android Geocoder Throwing a "Service Not Available" Exception
System.Loadlibrary(...) Couldn't Find Native Library in My Case
Android: Viewpager and Horizontalscrollview
How to Create a Circular (Endless) Recyclerview
Android Mediaplayer Stop and Play
Android What Does the Cliptopadding Attribute Do
What Is the Real Android Studio Gradle Version
Timepicker in Preferencescreen
Method Not Found Using Digestutils in Android
Intent Action for Network Events in Android Sdk
Alert Dialog from Android Service
Fool-Proof Way to Handle Fragment on Orientation Change
How to Fix "Unexpected Element <Queries> Found in <Manifest>" Error
Getting "Socketexception:Connection Reset by Peer" in Android