CSS·Intermediate·Scenario based·1 min read
How would you debug unexpected overflow?
Short interview answer
Identify the overflowing element, inspect its scroll width and computed constraints, then check unbreakable content, intrinsic minimums, fixed widths, transforms, and viewport units. Hiding overflow before finding the cause can mask inaccessible content.
Example
/* quick visual audit in devtools console */[...document.querySelectorAll('*')].forEach((el) => { if (el.scrollWidth > document.documentElement.clientWidth) console.log(el);});Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.