Why Does Elementor Full-Width Layout Have Left and Right White Margins?

When using the WoodMart theme with Elementor to build pages, many developers encounter this frustrating issue: even after setting the Container to Full Width in Elementor and enabling Stretch Container, obvious white margins still appear on the left and right sides of the page.

This article will fully walk through the troubleshooting process and provide a verified fix for the Elementor Full-Width white margin issue.


Problem Symptoms and Initial Investigation

The page behaves as follows:

  • Elementor Container has Content Width set to Full Width
  • Stretch Container is enabled
  • Creating a new Container for testing still shows white margins
  • The white margin width is approximately 15px (one on each side)

The most obvious assumption is a setting issue within Elementor itself, but after checking each possibility:

  • Elementor Full Width setting ✅ Correctly configured
  • Section / Container Padding ✅ Both set to 0
  • Testing with a new blank Container ✅ Issue still reproduces

Conclusion: The problem is not in Elementor, but in the theme's outer container.


Using Browser Developer Tools to Pinpoint the Root Cause

Open the browser F12 Developer Tools, run the following script in the Console to check the actual width of each container layer by layer:

var check = ['wd-page-wrapper','website-wrapper','main-page-wrapper','wd-page-content','elementor'];
check.forEach(function(cls) {
var el = document.querySelector('.' + cls);
if(el) {
var s = window.getComputedStyle(el);
console.log('.' + cls, '| width:', s.width, '| padding-left:', s.paddingLeft, '| padding-right:', s.paddingRight);
}
});

Element Width padding-left padding-right
.wd-page-wrapper 1137px 0px 0px
.main-page-wrapper 1137px 0px 0px
.elementor 1092px 0px 0px

It was found that .elementor is only 1092px, which is 45px narrower than its parent container. Further inspection of the parent element of .elementor:

var el = document.querySelector('.elementor');
var parent = el.parentElement;
var ps = window.getComputedStyle(parent);
console.log('parent class:', parent.className);
console.log('padding-left:', ps.paddingLeft);
console.log('padding-right:', ps.paddingRight);

The results reveal the truth:

parent class: container wd-entry-content
padding-left: 15px
padding-right: 15px

Root cause found: .container.wd-entry-content inherits Bootstrap's default padding: 0 15px, preventing the inner Elementor container from truly spanning the full width. This is entirely unrelated to Elementor's settings and is caused by the WoodMart theme's underlying Bootstrap styles.


Fix: Override in Child Theme CSS

The correct fix is to add the following CSS to the woodmart-child theme's style.css, rather than modifying the theme itself (otherwise, changes will be lost on theme update):

/* Elementor Full Width Fix: Remove default padding from Bootstrap container */
.container.wd-entry-content {
padding-left:0!important;
padding-right:0!important;
max-width:100%!important;
width:100%!important;
}
/* Ensure Elementor root element is not restricted by parent */
.entry-content > .elementor,
.wd-entry-content > .elementor {
width:100%;
max-width:100%;
}
/* Prevent horizontal scrollbar */
body {
overflow-x:hidden;
}

Add the above code to: /wp-content/themes/woodmart-child/style.css

Or, paste and save it directly in the WordPress admin under Appearance → Customize → Additional CSS.


Fix Not Working After Deploying Online? Check Cloudflare Cache

After successfully testing the fix locally, uploading it to the live server might still show the white margins. The Console confirms the child theme CSS file loads correctly, but the padding remains 15px.

Reason: Cloudflare or another CDN is caching the old version of the CSS file.

Solution:

  1. Log in to the Cloudflare dashboard
  2. Go to the relevant domain → Caching → Configuration
  3. Click Purge Everything
  4. Refresh the website; the white margins should disappear

If using other CDNs or server-side caching (e.g., LiteSpeed, Nginx FastCGI), you must clear the corresponding cache as well.


Reference HTML Structure

The actual DOM hierarchy for a WoodMart + Elementor page is as follows:

body
└── .wd-page-wrapper.website-wrapper
└── .wd-page-content.main-page-wrapper
└── .container.wd-entry-content ← padding 15px (root cause)
└── .elementor ← width is compressed
└── .e-con (Container)

Elementor only controls the innermost Container. The outer .container.wd-entry-content is injected by the WoodMart theme, and Bootstrap gives it a default padding of 15px on each side, which is the source of the white margins. For more information on WordPress theme development best practices, refer to the Google Webmaster Guidelines.


FAQ

Elementor full width is set but there are still white margins, what should I do?

White margins are usually not an Elementor issue but are caused by padding or max-width restrictions on the theme's outer container. Use F12 Developer Tools to inspect the parent element of the .elementor element, find the container with padding, and override it to 0 using !important in your child theme CSS.

I modified style.css but the live website hasn't changed?

The most common reason is that Cloudflare or another CDN is caching the old CSS file. Log in to the Cloudflare dashboard, perform a Purge Everything to clear the entire site cache, and then force refresh your browser (Ctrl+Shift+R) for the changes to take effect.

Why use a child theme instead of directly modifying the WoodMart theme's CSS?

Directly modifying theme files will cause your customizations to be lost when the theme is updated. Using a child theme's (woodmart-child) style.css is the WordPress-recommended best practice, ensuring theme updates do not affect your custom styles.

Will this method affect the layout of other pages?

No. The .container.wd-entry-content selector only targets the content area edited by Elementor. It does not affect WooCommerce shop pages, sidebars, headers, footers, etc.

Will I need to reapply the fix after a WoodMart theme update?

No. The fix code is placed in the child theme, and theme updates do not affect child theme files. You only need to re-add it if the child theme itself is overwritten; normal WoodMart theme updates will not touch the child theme.

 

Disclaimer: All articles on this site, such as no special instructions or labeling, are the site's original release. Any individual or organization, without the consent of this site, prohibit copying, stealing, collecting, publishing the content of this site to any website, books and other types of media platforms. If the content of this site violates the legal rights and interests of the original author, you can contact us to deal with.