Common Viewport Pitfalls
You'll learn how to avoid accidentally breaking zoom and accessibility on mobile devices.
Now that you understand viewport fundamentals, let's look at mistakes that harm user experience — particularly for users with vision impairments.
The user-scalable=no Problem
Some developers disable pinch-to-zoom with user-scalable=no in their viewport tag:
<!-- ❌ BAD: Prevents users from zooming -->
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
Why this is harmful: Users with low vision need the ability to zoom. Disabling it creates accessibility barriers and violates WCAG guidelines. Some designers use it to prevent "accidental" zooming, but the solution is worse than the problem.
The minimum-scale Restriction
Similarly, setting minimum-scale below 1 or maximum-scale too low restricts users:
<!-- ❌ BAD: Limits how much users can zoom -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
While maximum-scale=2 might seem generous, some users need 400% zoom or more. Let the browser handle it.
The Right Approach
Always respect user zoom preferences:
<!-- ✅ GOOD: Simple, accessible viewport -->
<meta name="viewport" content="width=device-width, initial-scale=1">
That's it. No zoom restrictions. Design your interface to work with zoom, not fight against it. Use proper touch target sizes (you learned this in lesson 382) and responsive layouts so users don't need to zoom just to read your content.
Key Takeaway: Never disable or restrict user zoom with user-scalable=no or restrictive scale values — it's an accessibility violation that prevents users with vision impairments from accessing your content.