Skip to content

Instantly share code, notes, and snippets.

@simbados
Created September 8, 2022 14:15
Show Gist options
  • Save simbados/5addca4f4805454fe157310ee264de58 to your computer and use it in GitHub Desktop.
Save simbados/5addca4f4805454fe157310ee264de58 to your computer and use it in GitHub Desktop.
No zoom on mobile
If you want to disable zoom on mobile use the following meta tag:
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
This will archieve the following:
- user can not zoom in or zoom out
- the page will always have a scale factor of 1
- as an added "bonus" this will get rid of the browser bounce, when the user reaches the end of the page while scrolling.
Use this technique with caution, because the accessibility of your page will suffer drastically.
No zooming means that your page might not be visible on some devices and that users have difficulty with accessing your website.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment