Viewport Meta Tag Misconfigured or Missing in Cursor Project
Your Cursor-generated web application appears zoomed out, zoomed in, or renders at an unexpected scale on mobile devices. Text might be tiny and unreadable, the page might show excessive whitespace, or users can't zoom in/out. The root cause is a missing, malformed, or incorrectly configured viewport meta tag.
The viewport meta tag is a single line of HTML that controls how mobile browsers render your page. Without it, mobile browsers assume your page is designed for a 980px desktop screen and shrink everything to fit. With incorrect values, you might lock users out of zooming (an accessibility violation) or cause the page to render at the wrong width.
This issue affects every mobile visitor to your site and is often the first thing that needs fixing for any mobile responsiveness improvements to take effect.
Error Messages You Might See
Common Causes
- Viewport tag missing entirely — Cursor generated an HTML file or layout template without the viewport meta tag in the head section
- Zoom disabled with user-scalable=no — Cursor added
user-scalable=noormaximum-scale=1which prevents pinch-to-zoom, violating WCAG accessibility guidelines - Fixed width viewport — The tag uses a fixed pixel width like
width=1024instead ofwidth=device-width, forcing a specific layout width - Multiple viewport tags — Cursor added a viewport tag but one already exists from the framework/template, causing conflicts with the browser using the last one
- initial-scale missing or wrong — Without
initial-scale=1, some browsers may not properly set the viewport width on orientation change
How to Fix It
- Add the correct viewport tag — Place this in your HTML head:
<meta name="viewport" content="width=device-width, initial-scale=1">. This is the recommended configuration for almost all web applications - Remove zoom restrictions — Delete
user-scalable=no,maximum-scale=1, andminimum-scale=1from the viewport tag. Users must be able to zoom for accessibility - Check for duplicate viewport tags — Search your entire HTML output for
name="viewport". If there are multiple, remove all but one and place it correctly in the head - Verify in framework layout files — For React (index.html), Next.js (app/layout.tsx or _document.tsx), or Svelte (app.html), check the root layout file where the viewport tag should live
- Test on real devices — Browser DevTools device simulation doesn't perfectly replicate viewport behavior. Test on actual phones to verify the fix
Real developers can help you.
You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.
Get HelpFrequently Asked Questions
Is it ever okay to disable zooming?
Almost never. WCAG 2.1 Success Criterion 1.4.4 requires that users can zoom to 200%. The only exception might be a full-screen web game, but even then, accessibility guidelines recommend allowing zoom. Some mobile form interactions can be improved without disabling zoom entirely.
What if my framework already handles the viewport tag?
Many frameworks like Next.js, Nuxt, and SvelteKit include a viewport tag in their default templates. Check your framework's documentation and root layout file before adding another one. Having duplicate viewport tags can cause unpredictable behavior.