How to fix horizontal scrolling issue on mobile
Unwanted horizontal scrolling on a Framer website often occurs when an element exceeds the viewport width due to specific properties. Here’s how to identify and fix the issue.
How to identify and solve the problem
Horizontal scrolling is usually caused by elements that are too wide for the viewport. While setting the overflow property to “hidden” can temporarily hide the problem, it might disrupt sticky elements. The real solution is to pinpoint and adjust the problematic elements.
Common causes of overflow issues
Fixed-width elements:
Elements with widths set in pixels (
e.g., 1200px
) that don’t adjust responsively.
Large min-width values:
Elements with a
min-width
value larger than the viewport.
Absolute positioning:
Elements with
position: absolute
placed outside or at the edge of the viewport.
Animation effects:
Animations with an X-offset, rotation, or scale that temporarily extend an element beyond the viewport.
Fit width:
Elements with
width: fit
that might exceed the viewport width.
How to fix overflow issues
Locate the problematic elements:
Check each element in your project based on the cues listed above.
Use Framer’s layout tools to inspect widths, positions, and animations.
Adjust widths:
Set the width of problematic elements to “fill” so they fit within the viewport.
Review animations:
Ensure any animations don’t cause elements to extend beyond the screen.
Verify in the browser:
Preview the site to ensure the horizontal scrolling issue is resolved.
Conclusion
To fix horizontal scrolling issues:
Adjust the width of elements causing overflow.
Avoid relying solely on the overflow “hidden” property, as it can disrupt sticky elements.
If the problem persists, reach out to our community support channel for assistance from a Product Specialist.