Why does a responsive website have horizontal scrolling?

Horizontal scrolling appears when at least one element is wider than the page’s available inline size or is positioned beyond its edge. Common causes include fixed widths, unbreakable strings, 100vw sections, negative margins, transformed elements, wide tables and flex or grid items with restrictive minimum sizes.
Start by comparing document.documentElement.scrollWidth with clientWidth. In developer tools, inspect elements that extend outside the viewport. Temporary outlines can make the offending box visible, but pseudo-elements and transformed children also need inspection.
Fix the source of the document overflow; hiding it leaves the geometry broken. Make media fluid, allow long text to wrap, replace rigid widths with max-width, add min-width: 0 to shrinking flex or grid children and give intentionally wide tables a labeled local scrolling container.
Check positioned menus, sticky bars and off-canvas navigation in both open and closed states. A hidden drawer translated off screen can enlarge the scroll area if the containment pattern is wrong. Box shadows usually do not affect layout overflow, while margins and actual transformed geometry can.
Test narrow widths, browser zoom, long translated content and validation messages. Scroll horizontally with keyboard and touch to confirm whether overflow is intentional. A responsive page should not clip every wide object globally; it should constrain each component according to its content and purpose. Include the pattern in responsive regression tests with long content, browser zoom and at least one narrow embedded context. Record the expected wrapping and focus behavior so later component changes can be checked against a known result.