Prevent iPhone from zooming in web-app with HTML


Giving a meta tag attribute "user-scalable=no" will restrict the user from zooming elsewhere.  

Prevent zooming all together by adding this meta tag to your head tag. This tells the mobile browser to use the same width scale and will not allow the user to zoom in at all, hence also disables that annoying behavior. However, some might argue that this is not a very user-friendly way to handle the problem.

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

The <select> element, used along with one or more <option> elements, creates a drop-down list of options for a web form. The <select> element creates the list and each <option> element is displayed as an available option in the list.

By setting the font-size of the input field to a font-size of 16px (or larger), we prevent the browser from zooming in on focus. Note that we use the device aspect ratio to set the font size of 16px only for devices which have the specified device-aspect-ratio.

select{
   font-size: 40px;
}

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 04-Mar-2020

8K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements