Why does width: 100vw cause horizontal scrolling?

An element with width: 100vw can create horizontal scrolling because viewport width may include the vertical scrollbar. The element becomes as wide as the full viewport while the document’s available content area is slightly narrower. Margins, borders or parent padding can make the overflow larger.
For a normal full-width block inside the page flow, use width: 100% or let the default block sizing fill its containing block. Apply box-sizing: border-box so padding and borders stay inside an explicitly declared width.
*, *::before, *::after { box-sizing: border-box; }
.section {
width: 100%;
max-width: 100%;
}
The problem can also come from the classic full-bleed pattern that offsets a 100vw child with negative margins. Subpixel rounding and scrollbar behavior vary across browsers. Prefer modern grid layouts with full-bleed tracks or use carefully tested logical margins because viewport scrollbar geometry can vary.
Find the actual overflowing element before adding overflow-x: hidden. Inspect the document’s scroll width, outlines and computed boxes. A global clipping rule can hide focus indicators, menus or content while leaving the broken width calculation in place. Test the solution with keyboard focus, touch input and a resized desktop window. Responsive geometry is only successful when every visible control remains reachable and the content keeps a logical reading order. 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. Recheck the component after font, spacing or browser-support changes. Responsive failures often return when a shared token changes, so the test should cover the limiting content state instead of one ideal screenshot.