Skillux

FIELD GUIDE / Responsive layouts

How to fix an AI-generated website that breaks on mobile

A desktop layout compressed onto a phone can hide controls or force the whole document to scroll sideways. Identify the element that cannot shrink before asking an agent to rewrite the responsive layout.

By Skillux · Published · Updated · 3 min read

01

Reproduce the mobile overflow with real content

Record viewport width, zoom, content and the control that becomes unusable. Include a long title, an unbroken reference and a populated table. Check intermediate widths: a page can fail between its named breakpoints.

In developer tools, inspect the elements extending beyond the viewport. Trace the constraint to its owner: a fixed width, intrinsic minimum size, non-wrapping row or oversized child. Change one suspected constraint at a time.

02

Repair the sizing constraint rather than hiding it

In flex and grid layouts, inspect whether the child can shrink around long content. A targeted minimum-width adjustment can help when intrinsic sizing is the cause. It will not repair an intentionally fixed-width chart. Review text, images and controls separately.

Avoid applying overflow-x: hidden to the document as a blanket fix. It can conceal clipped content and focus indicators. Verify the information and actions remain reachable after the repair.

03

Choose a mobile table pattern that preserves the task

For row-to-column comparisons, local table scrolling may work better than cards. Keep headers associated with cells and ensure the scroll region is discoverable and keyboard usable. Check the actual implementation with assistive technology.

For individual-record review, consider a summary linked to details. Do not remove columns solely because they are wide: decide where essential information remains available. Preserve filtering and sorting when users need them.

  1. Identify the comparison or action the table supports.
  2. Choose local scrolling, summaries or a detail view based on that task.
  3. Keep surrounding page content within the viewport.
  4. Check long cells, control labels and visible keyboard focus.

04

Retest content and transitions

Repeat the original failure with identical content. Check a narrower width, an intermediate width and enlarged text. Open menus and trigger form errors; sticky elements and overlays can fail even when the initial page fits.

Document the confirmed cause and component involved. Review another consumer of a shared layout after editing it. A responsive fix should explain where the content goes, not just show that a scrollbar disappeared.

Worked example

A long order reference expands the dashboard

Illustrative repair brief; inspect the actual implementation before choosing CSS.

Starting point

The page is wider than my phone. Hide horizontal scrolling.

More actionable

At 320 CSS pixels, inspect the long order reference and its parent grid. Repair the confirmed constraint. If the summary truncates it, preserve the full reference in accessible details. Keep filters reachable and review a populated table and keyboard focus.

The revised request identifies the symptom and the task that must survive the repair.

Take into your next review

Review checklist

  • The overflowing element and constraint are identified.
  • Long content does not expand the whole document.
  • Essential information remains reachable.
  • Table scrolling is local and keyboard usable where needed.
  • Intermediate widths, zoom and non-ideal states are checked.

Common questions

Why is my AI-generated website wider than the phone screen?

Inspect fixed dimensions, intrinsic minimum sizes, long strings and non-wrapping controls. Also verify viewport configuration. Find the actual cause before choosing a CSS repair; no single patch resolves every case.

Should I turn every mobile dashboard table into cards?

No. Cards can support individual-record review; tables preserve comparisons. Choose based on the task and retain essential information and controls.

Sources & scope

Primary references checked on November 16, 2026. These sources support the principles cited beside them. The workflow, briefs and checklists are Skillux editorial recommendations; the examples are illustrative, with no claimed performance results.

W3C Understanding documents explain individual success criteria; this article is not a complete WCAG conformance assessment. References do not imply endorsement of Skillux. Read our editorial approach.