Korean
Dark Mode Light Mode

Get the Hottest Updates

Disable Auto Zoom in Input tag

Have you ever experienced the screen zooming in when tapping an input field in a mobile web browser?

Have you ever experienced the screen zooming in when tapping an input field in a mobile web browser?

1. Enable Auto Zoom

This usually happens in iOS browsers and is caused by the font size of the input field being too small.
iOS is programmed to automatically zoom in when the font size of an input field is 15px or smaller.

Auto zoom occurs when the input field is focused

2. Disable Auto Zoom

Fortunately, the solution is very simple: just set the font size of the input fields to 16px or larger.
You can apply it in your CSS like this:

Advertisement

input { font-size: 16px; }
No auto zoom after applying CSS

If you want a more specific rule, you can write it like this:

input[type="text"], input[type="search"], textarea { font-size: 16px; }
Add a comment Add a comment

Leave a Reply

chevron_left Prev Post

Wordpress dashboard CSS not loading

Next Post chevron_right

How to Accurately Sync Your Server Time with Chrony

Advertisement