Categories
JavaScript Answers

How to prevent iPhone from zooming in on select in a web app with HTML?

Spread the love

Sometimes, we want to prevent iPhone from zooming in on select in a web app with HTML.

In this article, we’ll look at how to prevent iPhone from zooming in on select in a web app with HTML.

How to prevent iPhone from zooming in on select in a web app with HTML?

To prevent iPhone from zooming in on select in a web app with HTML, we can user-scalable=no in a meta tag.

For instance, we write

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

to add user-scalable=no into the content attribute value of the meta element.

This will prevent the iPhone from zooming in when we select text in our web app.

Conclusion

To prevent iPhone from zooming in on select in a web app with HTML, we can user-scalable=no in a meta tag.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *