Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Mobile layout broken: fix horizontal scroll and overlapping elements

SEO-251Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

A mobile layout is broken when the page does not fit the width of a phone. The two most common signs are horizontal scroll (you can drag the page left and right) and overlapping elements (text over images, a banner over a button, a menu covering content).

Common causes: an image, table, video embed or iframe with a fixed pixel width; a missing <meta name="viewport"> tag; a full-width section using 100vw next to a scrollbar; absolutely positioned elements; and popups or sticky bars that are not sized for small screens.

Why it costs you leads or sales

Most visitors from ads and search arrive on a phone. If the form is pushed off-screen, a button is covered or the text is cut off, they leave instead of filling in the form or buying. Google also uses the mobile version of your pages for indexing, so a page that is hard to use on mobile is a weaker page in search.

Where a broken mobile layout loses the lead
  1. Ad or search clickVisitor lands on a phone
  2. Page loads wider than screenSideways scroll, text cut off
  3. Form or CTAOff-screen or covered
  4. Lead or saleNever happens

A wide element breaks the page, so the steps after it are never reached.

Mobile form completion before and after a layout fixExample numbers
Mobile form completion before and after a layout fix (example)Broken layout: 1.2 % of mobile visitors who submit; Fixed layout: 3.4 % of mobile visitors who submit0131.23.4Broken layoutFixed layout% of mobile visitors who submit

Example: illustrative numbers only, not measured results.

How to check if your site has it

Check your pages on mobile
  1. Open device mode

    In Chrome, press F12 (or Cmd+Option+I on Mac), then Ctrl+Shift+M (Cmd+Shift+M) to toggle the device toolbar. Pick a narrow width such as 360 px.

  2. Look for sideways scroll

    Scroll the page. If a horizontal scrollbar appears or the page drags left and right, something is too wide.

  3. Find the culprit

    Paste the snippet below into the Console. It lists elements that stick out past the right edge of the screen.

  4. Check overlaps and taps

    Look at the header, sticky bars, chat widgets, cookie banners and popups. Tap your main button and form fields to make sure nothing covers them.

  5. Test on a real phone

    Emulators miss some issues. Open the page on at least one iPhone and one Android phone, in portrait and landscape.

Find elements wider than the screen (paste in the browser Console)javascript
const w = document.documentElement.clientWidth;
[...document.querySelectorAll('body *')]
  .filter(el => el.getBoundingClientRect().right > w + 1)
  .forEach(el => console.log(Math.round(el.getBoundingClientRect().right), el));

How to fix it

First make sure the page has the viewport tag in the <head>. Without it, phones render the page at desktop width and shrink it.

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

Then make the offending element flexible. These rules fix the most common causes.

Common fixes for elements wider than the screencss
img, video, iframe, svg {
  max-width: 100%;
  height: auto;
}

.table-wrap {
  overflow-x: auto; /* wide tables scroll inside their own box */
}

.full-width {
  width: 100%; /* use instead of 100vw */
}

pre, code, p, h1, h2, h3 {
  overflow-wrap: anywhere; /* long words and URLs wrap */
}
Fix it on your platform
  1. Use the culprit snippet to find the element

    Note its class, then check whether it comes from your theme, a page builder block or a plugin.

  2. Fix in the builder or Customizer

    In the block or page builder editor, switch to the mobile preview and set the width to auto or 100%. Add the CSS above under Appearance > Customize > Additional CSS.

  3. Check plugins and the theme

    Deactivate a suspect plugin on a staging copy to see if the overflow disappears. Update the theme, or ask its developer for a fix.

Mobile layout before and after

Broken

  • Page drags sideways
  • Image has a fixed 800 px width
  • Sticky bar covers the form button

Fixed

  • Page fits the screen width
  • Image uses max-width: 100%
  • Sticky bar sized for mobile, button always tappable

How to confirm it's fixed

Confirmation checklist
  • No horizontal scroll at 320, 360, 390 and 430 px widths
  • The console snippet lists no elements wider than the screen
  • Text, images and buttons do not overlap, in portrait and landscape
  • You can tap the main CTA and complete the form on a real phone
  • Popups, cookie banners and chat widgets do not cover key content
  • Google Search Console URL Inspection shows the page rendering correctly

How to prevent it happening again

Layouts usually break after a theme update, a new plugin, a new banner or an edit with a wide embed. Test on mobile every time you publish a new page or change a template, and check popups and third-party widgets after each change.

Habits that keep layouts safe
  • Preview every new page on mobile before publishing
  • Test after theme, plugin and app updates
  • Set max-width: 100% on images and embeds by default
  • Wrap wide tables in a scrolling container
  • Keep a standard set of test widths and devices

How FunnelGuard handles this

FunnelGuard detects this only partly. It runs your real customer journeys on a schedule and takes a screenshot at each step, so you can see a badly broken page, a covered button or a step that fails. It does not run a layout check: it does not measure page width, flag horizontal scroll or detect overlapping elements by itself.

To cover the rest by hand, use the checks above after every design change: open key pages in device mode, run the console snippet, and test the form and CTA on a real phone. When a journey step fails because a button is covered or a field cannot be reached, FunnelGuard sends one alert with a screenshot and a likely cause, which helps you spot the layout problem behind it. You can start with the Free plan (1 site, 2 journeys, daily checks, no card), or run the free read-only website audit.

Questions people ask

Why does my website scroll sideways on my phone?

Something on the page is wider than the phone screen, such as an image, table, embed or section with a fixed pixel width. Open the page in Chrome's device mode and run a script to list elements that extend past the screen edge, then make them flexible with max-width: 100% or percentage widths.

How do I find which element causes horizontal scroll?

Open your browser's developer tools in mobile view and paste a short script in the Console that lists elements whose right edge is beyond the viewport width. You can also remove sections one by one in the Elements panel until the scrollbar disappears.

Does a broken mobile layout hurt my Google rankings?

It can. Google mostly indexes the mobile version of a page, and a page that is hard to read or use on a phone gives visitors a poor experience. Fixing it helps people use the page, which is the main reason to do it.

Is overflow-x: hidden a good fix for horizontal scroll?

Only as a last step. It hides the sideways scroll but also cuts off content that is too wide, and it can break sticky elements. Find and fix the element that overflows first.

Why are elements overlapping on my mobile site?

Usual causes are absolutely positioned elements, fixed heights, sticky headers or bars, and popups or chat widgets sized for desktop. Check those elements at mobile widths and change their position, size or visibility for small screens.

Why does my page look fine in a desktop browser but broken on my phone?

The viewport meta tag may be missing, or the layout may only be tested at wide sizes. Add the viewport tag and test at 320 to 430 px widths, plus on a real phone, since emulators miss some issues.

Can FunnelGuard detect a broken mobile layout?

Only partly. FunnelGuard takes screenshots at each step of your journeys and alerts you when a step fails, but it has no layout check for horizontal scroll or overlapping elements. You still need to test mobile layouts by hand.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: Screenshots per step; no layout check.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.