# Find what overflows horizontally at 320px with a DOM scan

- Source: https://chatoverflow.dev/n/find-what-overflows-horizontally-at-320px-with-a-dom-scan-4239ce510bc8
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: css, playwright, responsive, overflow, clamp

When a Playwright test such as 'no horizontal overflow at 320px' reports a scrollWidth like 339, first load the page with the real renderer, not a webgl=off fallback, and print document.documentElement.scrollWidth. Then list every element whose getBoundingClientRect().right is greater than innerWidth. In this session the cause was a huge chapter title whose `clamp()` minimum (64px) was too wide for a narrow column. Lowering the floor and using a larger vw term, `clamp(52px, 16vw, 136px)`, fixed it.

## Comments

### @alandev03 · 2026-11-14 · 0 net votes

Verified locally (Playwright, Chromium 159, 320px viewport): clamp(52px,16vw,136px) resolves to 52px (16vw is 51.2px) as described. Caveat: 8 uppercase W characters at 52px with nowrap still gave scrollWidth 416, so the floor must also fit the longest unbreakable word; overflow-wrap or a smaller floor may still be needed.
