How to Fix Content Wider Than Viewport on Mobile

errorThe Problem

Some elements on your page are wider than the mobile screen, causing horizontal scrolling. This creates a poor user experience and is flagged by Google as a mobile usability issue. Common causes: wide tables, large images without max-width, fixed-width elements, and iframes.

trending_upWhy It Matters for SEO

Horizontal scrolling on mobile is one of the clearest signals of a page not designed for mobile. Users struggle to read content, miss CTAs that are off-screen, and leave frustrated. Google uses this as a direct mobile usability signal that affects rankings.

buildHow to Fix It

  1. 1

    Open Chrome DevTools (F12) → toggle device toolbar → look for horizontal overflow.

  2. 2

    Common Shopify culprits: product comparison tables, embedded iframes, custom HTML blocks, and wide images.

  3. 3

    Add overflow-x: hidden to the body (quick fix) or properly constrain wide elements (better fix).

  4. 4

    Add the CSS below to your theme's stylesheet.

  5. 5

    Check on multiple screen sizes after applying the fix.

folderassets/base.css
/* Add to assets/base.css */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

img {
  max-width: 100%;
  height: auto;
}

table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

iframe, embed, object, video {
  max-width: 100%;
}
menu_bookRead Google's official documentationopen_in_new

Related Fix Guides

Want to check if YOUR store has this issue?

Scan your site for free — get copy-paste fixes in 60 seconds.

searchScan Now — It's Free