Stop iPhone zoom on input focus
Safari zooms the page when someone taps a field whose text is smaller than 16px. The fix is one line of CSS.
Why it happens
When a field's text is 16px or larger, Safari on iPhone focuses it normally. At 15px or less, it zooms the page in so the text is readable, and the person has to pinch back out after typing. The behavior has been in iOS for years and also applies to Chrome and other browsers on iPhone, because they all use Safari's engine.
The fix
input, select, textarea {
font-size: 16px; /* or 1rem */
}
That is all. If your design uses smaller text in fields on a computer, scope the rule to small screens:
@media (max-width: 600px) {
input, select, textarea { font-size: 16px; }
}
What not to do
A common shortcut is to stop the zoom with maximum-scale=1 or user-scalable=no in the viewport tag. That also stops people with low vision from zooming the page, which fails WCAG 1.4.4 (Resize Text). Recent iPhones ignore it for pinch zoom anyway, so you get the accessibility problem for little gain. Fix the font size instead.
Check the computed size, not your CSS
The rule uses the size the browser actually draws. A field set to 0.875rem on a page whose root is 16px draws at 14px and zooms. A component library may set 14px on inputs deep inside its own stylesheet. The checker measures the computed size of each field in its preview, so paste your form together with its styles.
Does 16px look too big?
16px is the default body text size in every browser, so it rarely looks out of place next to normal text. If a field looks oversized, reduce its padding or height rather than the text. Keep the whole field at least 44px tall on phones so it is easy to tap: see touch target size.
Frequently asked questions
Does the zoom happen on Android?
Chrome on Android does not zoom on focus this way. The 16px rule is mainly about iPhone and iPad.
Is 16px measured in CSS pixels?
Yes, the computed font-size of the field. Text inside the field at 16px or more is not zoomed.
Found a mistake or want a check added? Write to contact (at) mobileformcheck.com.