On iPhone, the bottom part of the screen may contain the system gesture area. If a mobile menu, sticky button, popup, or bottom bar is positioned near the viewport edge, some of the content may end up underneath it. Users may not see the entire element or may be unable to tap the button.
CSS provides special safe-area variables that help add space according to the characteristics of the screen. In Elementor, you only need to assign a dedicated class to the relevant element and use this spacing where it is genuinely needed.
Which Elements Need Protection on a Mobile Screen
The problem most often occurs with elements that use position: fixed or sticky and sit against the bottom edge of the window. Regular page content usually scrolls with the document and does not require this adjustment.
The bottom system inset is especially important for interactive elements. If it covers text or a decorative background, the issue is inconvenient, but if it covers a button, it directly affects the user journey.
Apply protection to the following objects:
- a fixed bottom menu or navigation bar;
- a sticky CTA button, such as “Order” or “Call”;
- a mobile popup if its bottom edge touches the screen edge;
- a cart, form, or notification panel fixed at the bottom;
- the bottom section of an open mobile menu.
How to Add a Class to an Element in Elementor
First, select the container, section, or widget to which you want to apply the spacing. In the element settings, open the Advanced section and find the CSS Classes field. Add your custom class without a period, for example safe-bottom.
If the bottom panel consists of several nested containers, assign the class to the level that actually has the background and contains the buttons. Otherwise, the spacing may be added in the wrong place: for example, the outer container may grow while the inner content remains close to the edge.
You can place the CSS in Elementor Custom CSS, if this option is available in your configuration, or in your theme’s or site’s custom styles. For one specific element, a dedicated class is more convenient than a global selector such as .elementor-container.
- Use a clear class name: safe-bottom, mobile-bar-safe, or cta-safe-area.
- Do not add a period in the CSS Classes field—it is needed only in the CSS selector.
- Do not use one class for every container on the page without checking the consequences.
.safe-bottom {
padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
Spacing for a Regular Bottom Block
If the element is part of the normal page flow, use padding-bottom. In the example, 16px is the base inner spacing needed even on devices without a special system area. The env() function adds the value detected by the browser for the particular screen.
This approach preserves comfortable space below buttons and text. On a device without an additional system inset, the element will not receive an unnecessarily large empty area, while on a compatible iPhone, the content will be positioned higher.
- Keep the base spacing in calc() instead of relying only on env().
- Choose the base value according to the height of the buttons and the panel design.
- Check whether the element’s background also covers the added area: padding should usually remain inside the block itself.
.safe-bottom {
padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
How to Configure a Fixed Element Anchored to the Bottom
For an element with position: fixed, padding-bottom alone may not be enough. If its bottom edge is set with bottom: 0, the entire block or its background may remain too close to the system area. In this case, the safe spacing must be taken into account directly in the bottom coordinate.
Use this approach when you need to raise the entire panel above the bottom edge rather than simply moving its inner buttons away from it.
- Make sure the element actually uses position: fixed or another positioning method for which bottom applies.
- Do not add a large bottom value and the same padding value at the same time without a reason—the panel may move too far upward.
- If the background should extend to the bottom edge while the buttons need to sit higher, it is often better to combine padding-bottom with the correct inner-container structure.
.safe-bottom {
bottom: calc(16px + env(safe-area-inset-bottom));
}
Example for a Fixed-Position Panel
You can combine the base styles with positioning, but the exact values depend on the panel’s width, height, and structure. Below is a simple template for an element that already has the relevant class in Elementor.
.safe-bottom {
position: fixed;
left: 0;
right: 0;
bottom: calc(16px + env(safe-area-inset-bottom));
z-index: 1000;
}
Why viewport-fit=cover Matters
The safe-area-inset-bottom value works correctly in scenarios where the page can use the full screen area. For this purpose, the HTML document usually uses viewport settings with viewport-fit=cover. In WordPress, the relevant meta tag is often added by the theme or responsive template system, but this should not be assumed without checking.
If the CSS does not produce the expected result, check the generated page code and the viewport settings. Do not add a duplicate meta tag at random: two different viewport definitions can create other scaling problems.
In most modern browsers, where the system area does not require additional space, env() returns zero or has no noticeable effect. This is why the base spacing in calc() remains important.
- Check the viewport in the source HTML if the safe area is not working.
- Test the actual scenario in a browser rather than relying only on the Elementor editor preview.
- Do not judge iPhone behavior solely by the result in Chrome DevTools.
Testing on Devices and Common Mistakes
After publishing, open the page on an iPhone in portrait orientation and, if possible, landscape orientation. Check opening and closing the menu, displaying the keyboard in a form, scrolling the page, and tapping every button in the bottom panel.
Also check pages with short content. A fixed element can cover the last line or button even when the issue is not noticeable on a long page. In this case, you need to add bottom padding to the main content so it does not remain hidden under the panel.
- Adding the safe area to every section of the page is a mistake: it will create unnecessary gaps.
- Using only bottom: 16px without a system-dependent value is not sufficient for some devices.
- Applying padding to an inner element when the issue concerns the position of the entire fixed block.
- Forgetting z-index: the panel may not be covered by the system area but may appear underneath another site element.
- Checking only Elementor’s responsive preview instead of a real browser.
Frequently asked questions
Do I need to add this CSS to every mobile container?
No. Apply it only to elements positioned near the screen edge that may be covered by the system area: bottom panels, popups, sticky buttons, or menus.
What is the difference between padding-bottom and bottom?
padding-bottom adds inner space inside the block, while bottom changes the distance between a positioned element and the bottom edge. For a fixed panel, the choice depends on whether you need to raise the entire block or only its content.
Does env(safe-area-inset-bottom) work on Android?
Its behavior depends on the browser, device, and system configuration. On devices without a corresponding system area, the value usually does not create additional spacing, but the base space in calc() is still preserved.
Why is the spacing not visible after adding the CSS?
Check the class name, where the styles were added, the element’s positioning, and the page’s viewport settings. Also clear the site and browser caches if the CSS was changed but the old version is still being displayed.
Can I combine the bottom system inset with spacing for the page content?
Yes, but these spacings should solve different problems. Protect the panel with its own padding or bottom value, while the last part of the page content may need additional padding-bottom so it is not covered by the fixed panel.
Conclusion
For mobile Elementor elements, the safe area is not a global style for the entire page but a targeted solution for panels, menus, popups, and CTAs near the bottom edge. Create a dedicated class, add env(safe-area-inset-bottom) to the base spacing, and account for the bottom property for fixed elements as well.
Afterward, be sure to test the page on a real iPhone, in different orientations, and while interacting with menus or forms. This approach helps preserve button accessibility and predictable mobile interface behavior without adding unnecessary spacing elsewhere in the layout.