Horizontal scrolling on the mobile version of a WordPress site often appears even when there is no obvious element extending beyond the page. One of the most common causes is using width: 100vw in an Elementor container or widget.
The 100vw value is based on the viewport width—the visible area of the browser. On some devices, the space occupied by the vertical scrollbar may effectively be added to this width. As a result, the block becomes slightly wider than its parent container and creates horizontal scrolling. The steps below explain how to identify and fix the issue without simply masking it.
Why 100vw Creates Horizontal Scrolling
The vw unit equals one percent of the viewport width. Therefore, 100vw means the width of the entire viewing area, not the amount of available space inside the parent element. If the page already has a vertical scrollbar, the calculated width may be greater than the actual visible area.
The issue is especially noticeable on mobile devices, where the viewport width can change when the browser panel opens, the screen rotates, or system interface elements appear. If the element is inside a container with its own spacing, the difference can become even more significant.
For most full-width blocks, width: 100% is a safer option. It stretches the element within the available width of its parent container instead of forcing it to match the viewport.
- width: 100% — width within the parent element;
- max-width: 100% — prevents the element from extending beyond the container;
- box-sizing: border-box — includes padding and borders in the width calculation.
.full-width-safe {
width: 100%;
max-width: 100%;
box-sizing: border-box;
}
How to Find the Element Extending Beyond the Screen
Before changing the CSS, identify the specific element causing the issue. Check the page in mobile mode and, whenever possible, on a real smartphone, because editor emulation does not always reproduce actual browser behavior.
Open your browser’s developer tools, enable mobile device mode, and inspect the page structure. Select sections, containers, and widgets one by one, looking for the element whose boundary extends to the right. Temporarily adding an outline makes the actual dimensions of each block easier to see.
- check the body, main wrapper, sections, and inner containers;
- look for elements with width: 100vw, min-width, or a fixed width;
- check blocks with large padding, negative margins, or transforms;
- compare the element’s width with the width of its parent container;
- temporarily disable styles one at a time to quickly isolate the cause.
* {
outline: 1px solid rgba(255, 0, 0, 0.15);
}
What to Check in Elementor Settings
If the problem occurs only on mobile, check the responsive values at every level of the structure: the outer section, container, and inner widget. Elementor allows separate settings for different device types, so an incorrect value may be hidden only in the mobile configuration.
For a full-width design, it is better to stretch the parent container using Elementor’s own settings rather than expanding an inner widget to 100vw. The inner element should remain within the available width of its parent block.
- check the container width and maximum width;
- review the left and right padding on mobile;
- remove negative margins or limit them to the required breakpoint;
- make sure the inner container does not use 100vw without a real need;
- check fixed widths, min-width, and manually assigned widget dimensions;
- after making changes, clear the plugin, CDN, and browser cache if the site uses caching.
Hidden Causes of Horizontal Scrolling
The problem is not always directly related to the container width. An element may have the correct width but still extend beyond its boundaries because of other CSS properties. This most often involves decorative effects, sliders, animations, and oversized images.
Pay particular attention to shadows and transforms. For example, translateX, scale, or rotation can move an element beyond the viewport. Its formal width may remain correct, but the browser can still include the extended area in the scrollable region.
Also check images and iframes. They may have their own fixed width, while long words or unbroken lines can increase the width of a text block.
- box-shadow with a large blur or offset;
- transform: translateX(), scale(), or rotate();
- horizontal sliders, carousels, and menus;
- images without max-width: 100%;
- long URLs, product codes, or text using white-space: nowrap;
- iframes, tables, and code blocks with a fixed width.
img,
iframe,
table {
max-width: 100%;
}
img {
height: auto;
}
How to Fix the Problem with CSS
Once you have identified the cause, first replace 100vw with 100% on the specific element. Add max-width: 100% and box-sizing: border-box if the block contains internal spacing or a border. This usually resolves the issue without affecting other site components.
Do not immediately add overflow-x: hidden to the body or html. This may hide the symptom but does not remove the element extending beyond the layout. It can also crop shadows, menus, sticky elements, or horizontal content that users should be able to access.
If the overflow is intentional, such as with a decorative background, limit overflow on the nearest relevant container rather than across the entire page. Before doing so, make sure the container does not include interactive content that users need to scroll.
- replace 100vw with 100% on the problematic element;
- add max-width: 100% to images, iframes, and inner blocks;
- use box-sizing: border-box for blocks with padding;
- limit overflow only on the container that controls the decorative extension;
- do not globally hide horizontal scrolling without checking the consequences.
.problem-element {
width: 100%;
max-width: 100%;
box-sizing: border-box;
}
/* Only if the overflow is intentional */
.decorative-wrapper {
overflow-x: hidden;
}
Common Mistakes When Fixing the Issue
A common mistake is setting overflow-x: hidden on the entire page and considering the problem solved. The user no longer sees the scrollbar, but the underlying cause remains in the code. It may reappear after future changes or cause important content to be cropped.
Another mistake is changing only the widget width without checking its parent container. If the overflow is caused by a negative margin, transform, or padding on an outer block, changing the width will not solve the problem.
After applying a fix, test several screen widths, vertical scrolling, screen rotation, and pages with long content. Also test menus, popups, sliders, and sticky elements, because global CSS changes can affect their behavior.
- do not edit the site-wide CSS if the cause is located in a single widget;
- do not leave width: 100vw together with large horizontal spacing;
- do not confuse a clipped decorative background with useful horizontal content;
- check the result after clearing the cache and on a real mobile device.
Frequently asked questions
Is 100vw always a mistake in Elementor?
No. 100vw may be necessary for a background or a special full-width effect. The problem occurs when an element with this width is placed inside a container with spacing or accounts for the width of a vertical scrollbar.
Why is horizontal scrolling visible only on mobile?
The available width is much smaller on mobile, so even a minor overflow becomes noticeable. Responsive margins, padding, transforms, or widths may also have separate values for the mobile breakpoint.
Can I simply add overflow-x: hidden to the body?
It can be used as a justified additional safeguard, but not as the primary fix. First find the element extending beyond the layout and correct its width, spacing, or transformation.
What should I use to make a block full width?
In most cases, configure the Elementor parent container as full width, while leaving the inner element with width: 100% and max-width: 100%. This keeps the structure predictable across different screen sizes.
Conclusion
Horizontal scrolling caused by 100vw usually occurs because the element is tied to the viewport instead of the available width of its parent container. Start by finding the specific block, then check responsive spacing, negative margins, transforms, shadows, and fixed dimensions.
For standard full-width sections, use Elementor’s container settings and a relative width of 100%. Reserve CSS with overflow-x: hidden for controlled decorative cases rather than using it as a universal way to hide an error.