Why `100vw` Can Create Horizontal Scrolling
A viewport-wide child ignores the inline space already consumed by its padded page container and makes the document wider than the visible area.
width: 100vw- Viewport / page
- --
- Band
- --
- Page overflow
- --
width: 100%- Viewport / page
- --
- Band
- --
- Page overflow
- --
Three-browser evidence verified. Live values come from your current browser. The formal matrix records the controlled browser runs and fixture revision used for the published conclusion.
Observed failure
The viewport-wide child starts after the page gutter
The target starts inside a padded content shell but still claims the entire viewport width. Its left offset is therefore added to that width, and the document becomes wider than its viewport.
Minimal code diff
Size the child from its containing block
Use percentage or logical inline sizing when the intended boundary is the parent content box, not the browser viewport.
Before
.full-band {
width: 100vw;
}After
.full-band {
width: 100%;
}Root cause
Viewport units are resolved against a viewport, while percentage inline sizes are resolved against a containing block. Those boundaries happen to coincide in simple layouts, but they are not interchangeable once a child begins after a page gutter or inside another constrained wrapper.
The failing fixture deliberately places a 100vw band inside a padded shell. The band begins 16 CSS pixels from the left edge and then remains one full viewport wide, so the document needs additional horizontal space.
Diagnose the actual boundary
Start by comparing document.documentElement.scrollWidth with clientWidth, then inspect the target’s getBoundingClientRect(). In this fixture the useful signal is not the declaration alone: the band has a positive left offset and its right edge lands beyond the document’s visible inline edge. Inspect the parent at the same time. If the parent’s content box is the intended boundary, a percentage or inline-size: 100% expresses that relationship directly.
Temporarily hiding horizontal overflow can make the scrollbar disappear while leaving controls, focus rings, or text outside the reachable area. The regression therefore measures geometry and confirms that the complete band remains visible; it does not treat overflow-x: hidden on the page as a repair.
When this fix is not enough
Use 100vw when the viewport really is the intended sizing boundary. A full-bleed section may instead need a deliberate breakout pattern that accounts for its offset. If changing the width does not remove the overflow, inspect transforms, fixed media, negative margins, and descendants with large intrinsic sizes.
Regression condition
At each tested viewport, the failing document should report positive page-level overflow and the fixed document should report zero page-level overflow. The target element remains visible in both states.
Primary references
Sources checked for this case
- CSS Values and Units Module Level 4 - viewport-percentage lengths - W3C, checked 2026-08-04
- CSS Overflow Module Level 3 - W3C, checked 2026-08-04
Formal evidence
Browser and viewport matrix
Cells show failing / fixed page overflow in CSS pixels.
| Browser | 320 | 375 | 768 | 1024 | 1440 |
|---|---|---|---|---|---|
| Chromium | +16 / +0 | +16 / +0 | +16 / +0 | +16 / +0 | +16 / +0 |
| Firefox | +16 / +0 | +16 / +0 | +16 / +0 | +16 / +0 | +16 / +0 |
| WebKit | +16 / +0 | +16 / +0 | +16 / +0 | +16 / +0 | +16 / +0 |
12/12 recorded assertions passed
chromium-failing-overflow-32016pxchromium-fixed-overflow-3200pxchromium-failing-overflow-37516pxchromium-fixed-overflow-3750pxfirefox-failing-overflow-32016pxfirefox-fixed-overflow-3200pxfirefox-failing-overflow-37516pxfirefox-fixed-overflow-3750pxwebkit-failing-overflow-32016pxwebkit-fixed-overflow-3200pxwebkit-failing-overflow-37516pxwebkit-fixed-overflow-3750px
Run 2026-08-04T11-36-57-234Z. chromium 149.0.7827.201, firefox 153.0, webkit 26.5. Open raw manifest