All posts

Your AI-built app looks broken on phones: the fixes that matter

Your app looks fine on your laptop. On a customer's phone, the page slides sideways, text is cut off, the form zooms in and the main button hides behind the browser bar. Below are the fixes that matter, and how to ask Lovable, Bolt, Cursor or Replit for them. Browser facts come from MDN, W3C, Apple, Google and WebKit docs, checked in November 2026.

Short answer: test on a real iPhone and a real Android phone, not only in a narrow browser window. Most problems come from the nine causes below, and most fixes are a few lines of CSS. Never fix them by blocking zoom.

Before you fix: see what your customers see

Chrome's device mode docs call it "a first-order approximation" and say: "When in doubt, your best bet is to actually run your page on a mobile device." So test on an iPhone in Safari and an Android phone in Chrome. Chrome on iPhone is powered by Apple's WebKit, like Safari, so an iPhone tells you little about Android.

  • Android: Chrome's remote debugging guide: turn on USB debugging, connect a USB cable, open chrome://inspect#devices on your computer and click Inspect.
  • iPhone: you need a Mac. Apple's Web Inspector guide: turn on Web Inspector in the iPhone's Settings, Apps, Safari, Advanced, and Show features for web developers in Safari on the Mac. Connect a cable and use the Develop menu.
  • Narrowest screen: also try 320 pixels wide in device mode. The WCAG Reflow rule asks that content works at that width without scrolling in two directions, except parts like data tables.

1. The viewport tag is missing or blocks zoom

Symptom: the page looks like a tiny desktop page. MDN's viewport guide explains that some phones render pages in a virtual window wider than the screen, for example 980px, and then shrink it.

Fix: make sure the <head> has <meta name="viewport" content="width=device-width, initial-scale=1">. Never add user-scalable=no or maximum-scale=1. MDN's viewport reference warns that blocking zoom stops people with low vision from reading the page, and says iOS 10 and later ignore these settings by default anyway.

2. The page scrolls sideways

Symptom: you can drag the page left and right. One element is wider than the screen: a fixed width like width: 600px, a long URL, a wide table, an image, or flex items that won't shrink. To find it, add * { outline: 1px solid red; } for a minute and look for the box that crosses the right edge.

Fix, by cause:

  • Fixed widths: width: 100%; max-width: 600px;
  • Images and video: img, video { max-width: 100%; height: auto; }
  • Long words and URLs: overflow-wrap: anywhere; lets the browser break them (MDN).
  • Flex items: by default they won't shrink below their content (MDN's min-width page). Add min-width: 0; (min-w-0 in Tailwind) to the item with the long text.
  • Tables: wrap the table in a div with overflow-x: auto;, so only the table scrolls.

Don't hide it with overflow-x: hidden on the body. That only cuts off the right side.

3. Full-height screens are cut off

Symptom: a screen set to 100vh (min-h-screen in Tailwind) has its bottom part, often the main button, under the browser toolbar. Phone toolbars show and hide as you scroll, and MDN's length page says vh currently equals the "large" size: the height with the toolbars hidden.

Fix: use the newer units. From MDN:

  • svh (small): the height with the toolbars shown. Stable; MDN calls the small units "safer" to use in general. Use it when the bottom button must stay visible.
  • lvh (large): the height with the toolbars hidden, like vh today.
  • dvh (dynamic): follows the toolbars. MDN warns it "can cause the content to resize while a user is scrolling a page". Keep it for a screen that must fill the window exactly, like a map.

Write min-height: 100vh; min-height: 100svh; (min-h-svh in Tailwind). web.dev's viewport units article lists support from Safari 15.4, Firefox 101 and Chrome 108; an older browser ignores the svh line and keeps the first. Use min-height, not height, so content can grow.

4. The form zooms in when you tap a field

Symptom: on an iPhone, tapping an input zooms the page in. It is widely reported that Safari on iPhone does this when the field's text is smaller than 16px. I found no Apple or WebKit page that documents the rule, so treat it as observed behaviour.

Fix: input, select, textarea { font-size: 16px; }. Don't block zoom instead (see fix 1).

5. Buttons and links are too small to tap

Symptom: people tap the wrong thing or tap twice, often on icon buttons like a close X. What each source says today:

  • WCAG 2.2, 2.5.8 Target Size (Minimum), level AA: at least 24 by 24 CSS pixels. Exceptions include small targets with enough space around them and links inside a sentence. The stricter 2.5.5 (level AAA) uses 44 by 44 CSS pixels.
  • Apple's Human Interface Guidelines (for native apps): a default control size of 44x44 pt on iPhone and iPad, and 28x28 pt as the minimum.
  • Material Design: "For most platforms, consider making touch targets at least 48 x 48dp", and, in most cases, 8dp or more between targets.

Fix: a simple rule for web apps: 44 by 44 CSS pixels for anything tapped often, 8 pixels between targets, and never below 24 by 24. For an icon button, keep the icon small and grow the tap area: min-width: 44px; min-height: 44px;. Selling to EU consumers? Also read the European Accessibility Act for small apps.

6. Bars hidden behind the notch or home bar

Symptom: a bottom bar sits under the iPhone's home indicator, or content goes under the notch in landscape. Check your viewport tag for viewport-fit=cover. MDN says cover scales the page "to fill the device display", and it's "highly recommended" to use the safe area variables with it.

Fix: pad the edges with env(safe-area-inset-*). MDN's env() page says these give the safe distance from each edge, and are 0 when nothing is in the way. For a bottom bar: padding-bottom: calc(1em + env(safe-area-inset-bottom));. WebKit's iPhone X post explains the background.

7. Menus and tooltips that need a mouse

Symptom: on a phone, a hover dropdown doesn't open or won't close, and tooltips never show. MDN's hover page notes that many mobile devices only emulate hovering with "an inconvenient long tap".

Fix: open menus with a tap on a real <button>, which also works with a keyboard. Put hover-only effects inside @media (hover: hover) { ... }. Don't hide needed information in a tooltip: show it as text, or open it on tap.

8. Heavy images that make the page jump

Symptom: text jumps down while images load, and pages are slow on mobile data. Fix: give every image width and height attributes. MDN's img page says this reserves the space before the image loads, "reducing or even preventing a layout shift". Add srcset and sizes so a phone picks a smaller file: srcset="photo-400.jpg 400w, photo-800.jpg 800w" sizes="(max-width: 600px) 100vw, 600px". Resizing uploads and lazy loading are in why your AI-built app is slow.

9. The keyboard covers the field

Chrome's viewport article says that from Chrome 108, Chrome on Android only resizes the visual viewport when the keyboard opens, and says to look out for position: fixed elements. MDN documents interactive-widget=resizes-content to make the layout adapt to the keyboard, but the article says only Chrome supported it at the time of writing, and I found nothing saying Safari does. So keep the submit button in the form's normal flow, not in a fixed bar.

How to ask your AI tool for these fixes

"Make it mobile friendly" invites the tool to rewrite half your layout. Name the page, the phone, the symptom, the fix and what must not change. Two examples:

  • "On phones 320 to 430 pixels wide, the /pricing page scrolls sideways. Find every element wider than the screen and fix it with max-width: 100%, overflow-wrap: anywhere for long text, min-width: 0 on flex items, and an overflow-x: auto wrapper around the table. Don't use overflow-x: hidden on html or body. Don't change the desktop layout."
  • "On iPhone Safari, the sign-up form zooms in when I tap a field, and the Continue button is hidden behind the browser bar. Set font-size: 16px on all inputs, selects and textareas. On this screen, replace min-h-screen with min-h-svh. Don't add maximum-scale or user-scalable to the viewport tag."

Ask for one fix per prompt, and check it on a phone before the next. If each prompt breaks something else, start with the first tests worth writing.

Checklist on a real phone, after each change

  1. Open the page on an iPhone in Safari and an Android phone in Chrome.
  2. Try to drag the page sideways. It must not move.
  3. Scroll down and back up. The main button stays visible and nothing jumps.
  4. Tap each form field: no zoom, and the field stays visible above the keyboard.
  5. Tap every button, icon and menu with your thumb. You hit what you aim for, and menus open and close.
  6. Turn the phone sideways. Nothing hides behind the notch or the home bar.
  7. Pinch to zoom. It must still work.
  8. Do the main thing your app is for, start to finish, on mobile data.

Before a launch, also go through the launch-ready checklist. Not sure the app is worth fixing? Read fix it or rebuild it.

Users asking for "the app"? See installable web app or App Store.

Want this fixed for you?

I finish and fix apps built with Lovable, Bolt, Cursor or Replit, including making them work properly on phones. Or send me the details and I'll reply within 24 hours.