From time to time, elements on a page may be situated beyond the viewport, resulting in an unintended outcome of horizontal or lateral scrolling that reveals additional empty space around your layout. Not all horizontal scrolling is undesirable, but if it conflicts with your design, we will guide you on how to prevent it using Excess: concealed, adaptive design, and intentional interaction setup.
Within this tutorial, you will understand the following:
- Reasons for excess occurrences
- Methods to identify excess
- Strategies to resolve excess problems
Reasons for excess occurrences
Numerous factors can lead to unwelcome horizontal scrolling in your design, but typically it arises due to one of two reasons:
- The design layout includes an element that is dimensioned or located in a manner that shifts it off the screen and beyond the viewport.
- Activities or animations that commence off-screen. For instance, if you have a Heading entering from the side, its initial location off the screen when the page loads may cause overflow, despite the Heading ultimately reaching the correct position after the animation completes.
Excessive horizontal scrolling may arise from a different scenario than the two mentioned above, but layout and animation-related overflow usually manifest the most.
Methods to identify excess
Horizontal scrolling is not constantly negative. Nevertheless, when checking for excessive horizontal scrolling, watch out for anything that gives the impression that your layout’s boundary (typically the right side of your design) is not working as intended. In simpler terms, seek out additional space or elements extending past the edge of your layout’s boundary during scrolling. You can assess this in the Designer and the published site.
In the Designer, to identify potential unwanted horizontal scrolling:
- Access the Designer
- Scroll left and right to observe any elements overflowing outside the viewport
- Resize the Designer canvas
- Adjust the canvas size to assess responsiveness and fluidity
Note: If you are using a trackpad or a mobile device, scroll left and right — but with a mouse wheel, holding down Shift typically enables left and right scrolling.
Learn more about creating responsive designs.
To identify unwanted excess on your published site (especially with interactions active):
- Publish your site
- Check if your interactions cause surplus space to the right of your layout (especially on mobile devices)
Excess whitespace commonly arises with interactions as the browser continues to think the interaction requires the additional width that was utilized at the start of the animation even after the interaction finishes.
Strategies to resolve excess problems
You can prevent horizontal scrolling through various methods:
- Utilize Excess: concealed
- Evaluate your layout and its responsiveness
- Be mindful of your interaction setup
- Explore alternate solutions
- Apply Excess: concealed to the entire page
Utilize Excess: concealed
Establish the parent element’s Overflow as hidden:
- Identify the element causing the undesired horizontal scrolling (e.g., an Image element)
- Select its parent element (e.g., a Section)
- Access Style panel > Size
- Set Overflow to hidden
- Scroll left and right to verify if the excess horizontal scrolling has been removed