Elements + Resize · 8 minutes
Investigate a broken mobile layout
A page that scrolls sideways usually needs a smaller investigation than “make everything responsive.” Find the element that extends past the viewport, understand why it is wide, and decide whether it should wrap, shrink, or scroll inside its own container.
Before you start
Enable Codable’s Safari extension and open the local demo from the app’s Extension screen. Use a narrow Safari window or an iPhone. The demo is normally responsive; the first step creates a temporary overflowing table so you have a known problem to investigate.
Codable on the App Store ↗Create a controlled example on the local demo
Open Codable → Console. Review this snippet, then run it only on the bundled demo. It adds a small sample table with a deliberately fixed width. It makes no network request and contains no private data. Reload the demo to remove it.
(() => { const panel = document.querySelector('[data-panel="elements"]'); if (!panel) return "Open the Codable local demo first."; document.querySelector("#wide-demo")?.remove(); const table = document.createElement("table"); table.id = "wide-demo"; table.style.width = "900px"; table.innerHTML = "<tr><th>Item</th><th>Status</th><th>Owner</th></tr>" + "<tr><td>Example page</td><td>Ready to inspect</td><td>Demo</td></tr>"; panel.append(table); return "Added a 900px practice table. Reload to remove it."; })()Check: At a narrow width, the table extends beyond its panel.
Measure the overflow
Run this read-only check in Console. The table’s bounding box should extend beyond the layout viewport. The document’s scroll width helps confirm that there is page-level overflow.
For a real page, replace #wide-demo with the element you are investigating. Transforms and intentionally off-screen controls can also extend beyond the viewport, so measurements identify candidates rather than a guaranteed cause.
(() => { const table = document.querySelector("#wide-demo"); const box = table?.getBoundingClientRect(); return { viewport: document.documentElement.clientWidth, pageWidth: document.documentElement.scrollWidth, tableWidth: box?.width, tableRight: box?.right }; })()Check: The table measures 900 CSS pixels, wider than a narrow phone viewport.
Try a fix on the element, then check its parent
Choose Elements → Select, tap a table cell, then reopen Codable. In Tree, move up to the table element with id wide-demo. Open Style, change the width value to 100%, and tap Save. Close the popover and inspect the result; run the measurement again.
This small example has short content, so a fluid width is enough. A real data table may need a wrapper with overflow-x: auto to preserve readable columns. A flex or grid child may need min-width: 0. Long unbroken text may need overflow-wrap: anywhere. Test the cause you found instead of hiding overflow on the entire page, which can conceal content and controls.
Check: The sample table fits its panel, and page-level sideways scrolling disappears.
Verify the fix at neighboring sizes
Make the change in your site’s source, then test just below and above the width where it failed. Codable’s Resize tool can open a page and vary W, H, and Scale or use Presets. Width and height are layout points; Scale changes how the viewport fits on your screen. A DPR setting does not mean the layout is that many times wider.
Resize uses its own WKWebView session. Your Safari login and temporary inspector edits do not carry over. For an authenticated Safari-only bug, stay in that Safari session and compare real window sizes or devices. Use Resize with your development page when you can reproduce its state there.
If you get stuck
The page still scrolls sideways
Check the parent’s width and padding, then look for another oversized sibling. Images, fixed min-widths, long text, and nested flex or grid layouts are common candidates. Fixing one table may reveal another source of overflow.
The table fits but content is unreadable
Shrinking is not always the right treatment. Keep enough room for the data and try horizontal scrolling on a dedicated table wrapper. Check that the scrollable region can be reached and understood with touch and assistive technology.
Resize behaves differently from Safari
Compare the URL, login state, loaded data, and viewport first. User-agent selection changes signals sent to a site; it does not turn WebKit into Chrome or Firefox. Verify the final fix in the actual browser and device you support.
What this can tell you
- A live Style edit is a hypothesis you can test. It does not prove the cause across all content, font sizes, or breakpoints, and it does not change the website’s source files.
- CSS layout measurements are not screenshot pixels. Browser zoom, transforms, display scale, and device pixel ratio can affect how measurements appear on screen.
- Test large text, long translated content, keyboard appearance, and narrower windows as well as a device preset. A preset alone is not a responsive-layout audit.
For a full debugger connected to a Mac, Apple documents remote inspection of iOS and iPadOS. For extension setup, see Apple’s Safari extensions guide.