Designing a seamless, professional-looking website is often about managing space effectively. Gaps in Divi Builder – particularly excessive white space between sections, rows, or modules – can disrupt your layout, leading to a fragmented and less engaging user experience. This post aims to guide beginners in understanding and minimizing these gaps while offering simple solutions to enhance layout cohesion.
What Causes Gaps in Divi?
Gaps in your website layout can originate from a variety of settings within Divi Builder. Here's a breakdown of the common culprits:
Margins
Margins are like an element's personal space, dictating the distance between it and other elements. They can be set on all sides and have a significant impact on layout gaps. Large or negative margins can push elements apart unnecessarily, resulting in unsightly gaps.
Margins can be adjusted in Divi elements here:
- {Module} Settings > Design > Spacing > Margin

Padding
Padding expands an element by adding space inside its borders, pushing its content away from neighboring elements. This can inadvertently create gaps if not carefully managed.
Padding can be configured in:
- {Module} Settings > Design > Spacing > Padding

Heights / Min-Heights
Setting specific heights or minimum heights can also lead to gaps by forcing elements to maintain certain dimensions, pushing subsequent content further down the page. Misuse of this feature can particularly affect mobile layouts, where content resizing often requires different height parameters.
Heights can be set here:
- {Module} Settings > Design > Sizing

Position Settings
Position adjustments can directly shift elements from their original place, potentially leaving unintended gaps. These adjustments are often made with absolute values, which lack responsiveness across different screen sizes.
Position settings are found at:
- {Module} Settings > Advanced > Position

Other Causes of Gaps
While margins, padding, heights and position settings are some of the most common sources of gaps affecting Divi layouts, they are by no means the only ones. Other sources of gaps include the section and row heights in the customizer layout settings and mobile styles and the row gutter width in the customizer and rows themselves.
For now, we'll focus on dealing with the most common sources of gaps, but it's always worth being aware of the many ways in which gaps can occur.
Removing Gaps
Minimizing gaps effectively requires a balance of design sensibility and practical adjustments. Here’s how you can approach it:
Clear Positioning Values
Avoid using position settings to eliminate gaps. Moving elements with absolute positioning can lead to a cascading effect where multiple sections require adjustments, complicating your design with non-responsive fixes.
Clear Negative Margins
Negative margins should generally be avoided unless there's a purpose. They can be unpredictable and often complicate responsive design.
Use Heights Sparingly
Height settings should only be used when necessary for ensuring consistent element sizing, rather than for adjusting spacing. For example, if your goal is consistent spacing, use margins or paddings to achieve it instead.
Rely on Positive Margins and Padding
By using positive margins and padding, you can create a clean, manageable layout. This approach reduces the complexity of your design, making any gaps easy to identify and adjust. Margins and padding offer a flexible way to control spacing.
Identifying the Cause of Gaps
Once we've simplified our layout, we can then use the browser's element inspection tools to track down the sources of gaps, like so.
Inspect the Gap-Forming Element
To identify the cause of a gap, right-click on the gap in your browser and select “Inspect.”

Determine Whether the Gap is Caused by Padding or Margin
The browser's developer tools will highlight the gap’s source, displaying content in blue, padding in green, and margin in orange.

With these insights, you can accurately tweak the responsible settings and minimize gaps.
Handling Different Device Widths
By following the above approach, your pages should have fewer issues on mobile and other device widths. If positive margin and padding are used for spacing and positioning, height and negative margins minimized, then the layout should naturally work reasonable well on mobile too. But, of course, there may be fine-tuning to be done, hopefully just to the margin and padding. For this, you can use Divi's built-in responsive values feature that lets you set different values on desktop, mobile and tablets. You can learn more about it here:
Conclusion
By refocusing on using positive margins and padding combined with minimal height and position adjustments, you can create a more robust, responsive design. This straightforward approach simplifies the troubleshooting process and allows you to craft a cleaner, more cohesive layout. Remember, less is often more – simplify and improve your design for better results.
Nice article for Divi beginners! Just wanted to add on to it by mentioning a few other places that cause gaps: the section and row heights in the customizer layout settings and mobile styles and the row gutter width in the customizer and rows itself.
Thanks JP! You're exactly right. I've updated the post to include a mention of these. I'll only give them a passing mention as my real aim for this post is to have something which helps with the case I see frequently where the desktop layout has been rearranged using fixed heights, negative margins, positioning and so on, which makes the desktop view look okay, but then leads to a mess of gaps on mobile. Down the track I'll try to do a more comprehensive post on tracking down the causes of gaps which expands on the sources you've identified. Thanks again for your insights!