Home » Speed & Mobile » Missing Viewport Meta Tag: Why Your Site Looks Tiny on Phones

Missing Viewport Meta Tag: Why Your Site Looks Tiny on Phones

Published 2026-10-03 | Speed & Mobile

Missing Viewport Meta Tag: Why Your Site Looks Tiny on Phones banner

Open a site on your phone and see a tiny version of the desktop layout that you have to pinch and zoom to read? The page is almost certainly missing one line in its <head>:

<meta name="viewport" content="width=device-width, initial-scale=1">

What the tag does

When smartphones arrived, most websites were built for screens about 1000 pixels wide. To show them at all, mobile browsers pretend the screen is around 980 pixels wide, lay the page out at that size, then shrink the result to fit the phone. Text becomes unreadable and buttons tiny.

The viewport tag tells the browser: "this page is designed to adapt; use the device's real width". Without it, even a fully responsive design with media queries is shrunk like an old desktop page, because the browser never reports the small width that would trigger the mobile styles.

Step 1: check for the tag

View the page source (or use curl) and look for name="viewport":

curl -s https://example.com/ | grep -i viewport

Also run Lighthouse in Chrome DevTools. Its SEO and Best Practices audits flag "Does not have a <meta name="viewport"> tag with width or initial-scale".

Step 2: add it to the head

Place it inside <head>, near the top:

Platform Where
Hand-coded HTML Every page's <head>, or the shared header include
WordPress The theme's header.php. Modern themes already include it; a missing tag usually means a very old theme.
Next.js Added automatically by the framework; customise with the viewport export
Site builders Normally automatic; check the "custom head code" setting if not

Use exactly width=device-width, initial-scale=1. Avoid width=320 or other fixed numbers, which break on other devices.

Step 3: check what overflows

Adding the tag makes the page use the real phone width. Anything with a fixed width larger than that now sticks out, causing sideways scrolling. Common causes:

  • Containers with width: 960px instead of max-width: 960px.
  • Images without max-width: 100%.
  • Wide tables.
  • Long URLs or code lines that cannot wrap.
  • Embedded videos and iframes with fixed sizes.

A small set of rules fixes most of them:

img, video, iframe { max-width: 100%; height: auto; }
.container { max-width: 960px; width: 100%; }
table { display: block; overflow-x: auto; }
pre, code { overflow-wrap: anywhere; }

To find the culprit, open DevTools, switch to device mode (Ctrl+Shift+M), and scroll right. The element sticking out is the one to fix.

Step 4: test on a real phone

Emulators are good but not perfect. Load the site on an actual phone and check that text is readable without zoom, buttons are easy to tap, and nothing scrolls sideways. See mobile layout broken for a fuller testing routine.

Common mistakes

  • Disabling zoom with user-scalable=no.
  • Adding the tag to the homepage template but not to other templates.
  • Adding the tag twice with conflicting values.
  • Fixing overflow by hiding it (overflow-x: hidden on body), which cuts content off instead of fitting it.

Frequently Asked Questions

Should I use maximum-scale=1 or user-scalable=no?

No. They stop visitors from zooming, which is an accessibility problem for people with low vision. Modern browsers often ignore them anyway. Use the plain viewport tag.

I added the tag and the page now scrolls sideways. Why?

Something on the page is wider than the screen: a fixed-width container, a large image, a wide table or long unbroken text. The tag stopped hiding it. Find and fix the overflowing element.

Does the viewport tag affect SEO?

Search engines index the mobile version of pages. A page without a viewport tag fails mobile-friendliness checks and gives phone users a poor experience, which reflects on how useful the page is.

Found a mistake or still stuck? Contact us. See how we write and check these guides in our editorial policy, or read about DocumentGuy.

More in Speed & Mobile