Unexpected horizontal scroll bars and white space often occur in Webflow when using 100vw
, because 100vw
does not account for the browser's scrollbar width. Here's how to prevent this issue effectively.
100%
instead of 100vw
for full-width elements whenever possible. 100%
respects the actual visible width minus the scrollbar.100vw
only for specific cases, like fullscreen sections where scrollbars are not present (e.g., splash pages or modals).100vw
, fixed pixel sizes, or excessive negative margins.position: absolute
or fixed
and left/right offsets.overflow: hidden
on the body
and html
or on a wrapping div
to restrict unwanted overflow.Overflow: hidden
ORdiv
(like Wrapper
) and set Overflow: hidden
on that instead.100vw
.calc()
for Precise Widthswidth: calc(100vw - 17px)
(17px is an average scrollbar width; adjust if needed).max-width: 100%
on full-width elements to avoid unintended overflow on smaller devices or when using 100vw
.To prevent horizontal scrollbars and white space in Webflow, avoid using 100vw
in layouts where vertical scrolling exists. Use 100%
widths, apply overflow: hidden
where appropriate, and inspect layout issues with DevTools to catch elements causing overflow.