Glitchmark
Log in
Colour theme

Why my website looks broken on mobile

By Afaq Ahmad. Published , last updated .

A website looks broken on mobile because something on the page is wider than a phone screen, usually an element with a fixed width such as a table, an image or a code block. Open the page at 390 pixels wide in Chrome DevTools, find what makes the page scroll sideways and let it shrink, wrap or scroll inside its own box.

Free tool for this: Free mobile view checker. It checks one page, with no sign-up.

Find the element at fault

In Chrome, you can find it in a few steps:

  • Open the page and press F12, then Ctrl+Shift+M (Cmd+Shift+M on a Mac) for device mode.
  • Set the width to 390 pixels.
  • If the page scrolls sideways, open the Console and run: document.querySelectorAll("*").forEach(e => { if (e.getBoundingClientRect().right > innerWidth) console.log(e) })
  • The elements it lists are wider than the screen. The outermost one is usually the cause.

The five usual causes

  • A fixed width. A table, card or image set to a width in pixels, such as 600 px, that is wider than the screen. Use max-width: 100% instead.
  • Wide content that cannot shrink: tables, code blocks and long unbroken words or addresses. Let them scroll inside their own container (overflow-x: auto) or wrap.
  • A box that hides text that does not fit. A fixed-width box with hidden overflow and no wrapping cuts the text off. Let the text wrap, or show “...”.
  • Text placed on top of other text with absolute positioning, which works at one width and collides at another.
  • A menu built for a mouse. Hover menus cannot be opened by touch, so give the menu a button.

How to fix the most common one

If a pricing table is 600 pixels wide, remove the fixed width and set max-width: 100%, or wrap it in a container with overflow-x: auto so only the table scrolls and the page does not. Check the page again at 390 and 768 pixels. If you use an AI builder, tell it the element, the width and what you see, for example: “On a 390 pixel screen the .pricing-table element is wider than the screen and the page scrolls sideways. Make it fit.”

Check every page, not just one

A fix on one page leaves the same fault on others. The free mobile view checker checks one page at the three widths that matter, 390, 768 and 1440 pixels, and marks content that runs off the screen, text that is cut off and text that overlaps. A Glitchmark scan does it for every page it can reach, up to your plan’s page limit.

Questions

Why does my website scroll sideways on a phone?

Something is wider than the screen. Find it in Chrome DevTools at 390 pixels wide, then let it shrink or scroll inside its own box.

Do I need the viewport meta tag?

Yes. Without <meta name="viewport" content="width=device-width, initial-scale=1"> a phone shows the page as if it were a wide desktop screen, shrunk down.

Does it look the same on every phone?

Not always. Phones range from about 360 to over 430 pixels wide. Fixing the layout at 390 handles most of them; also try a narrower width such as 360.

Check your whole site, not one page

Glitchmark opens your site in real browsers on phone, tablet and laptop, finds what is broken and explains each problem in plain English. Your first scan of one site is free, with part of the report.

Scan my site free