Change the Spacing Between Columns in Divi Rows

Written by Dan Mossop

The Divi Theme allows you to lay modules out side-by-side in multi-column rows. However, it is not particularly obvious how to adjust the spacing between the modules in adjacent columns. Fortunately, Divi's 'gutter width' options within the row settings offer a degree of control over this space. However, the built-in settings are limited. This document provides a step-by-step guide on how to enable custom gutter widths using the Divi Theme's settings and custom CSS.

To change the spacing between modules in adjacent Divi row columns:

  1. Go to Row Settings > Design > Sizing.
  2. Enable 'Use Custom Gutter Width' to reveal the 'Gutter Width' option
  3. Choose a value (1-4) for the 'Gutter Width'

For more control, you can use CSS to set a custom gutter width

Here's an example of a three-column row with default spacing between the columns / modules: 

Adjusting Module Spacing in Divi Rows Using Gutter Options

When configuring a Divi row containing multiple columns, the space between modules can be adjusted using gutter options within the row settings. Here's how to customize the gutter width beyond the standard settings provided by Divi.

  1. Navigate to Row Settings > Design > Sizing.
  2. Activate the 'Use Custom Gutter Width' option to reveal the 'Gutter Width' setting.

The Gutter Width setting provides four discrete margin (i.e. "gutter") values for columns within a row:

  • Value 1: No margin
  • Value 2: Margin of 3%
  • Value 3: Margin of 5.5% (default setting)
  • Value 4: Margin of 8%

Note that this margin is applied to the right side of all columns except the last one.

Here's and image depicting module settings when a custom gutter value of 2 is selected: 

And here's an image showing the row appearance after applying a custom gutter width: 

Implementing Custom Gutter Widths with CSS

To achieve more granularity in gutter width beyond the preset values, the following CSS can be applied:

@media only screen and (min-width: 981px) {

	.row-with-custom-gutters .et_pb_column {
		--num-cols: 3;
		--gutter-width: 4%;
	}
	
	.row-with-custom-gutters .et_pb_column:not(.et-last-child)  {
		margin-right: var(--gutter-width) !important;
	}
	
	.row-with-custom-gutters .et_pb_column  {
		width: calc((100% - (var(--gutter-width) * (var(--num-cols) - 1))) / var(--num-cols)) !important;
	}
}

To utilize the above CSS, the class row-with-custom-gutters needs to be added to the row's CSS class field, which is located in Row Settings > Advanced > CSS ID & Classes.

The –num-cols value should be set to the same as the number of columns in the row, and the –gutter-width should be set to the desired right margin on the modules (which dictates the gutter spacing. 

Applying this CSS provides complete control over spacing, allowing for precise adjustment of margins between columns and modules within a row. 

Optimize Spacing with Divi Booster

Fine-tune the spacing between columns and unlock hundreds of new features with Divi Booster! Experience enhanced design control in Divi with ease.

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

0 Comments

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

Your email address will not be published. Required fields are marked *.

We may earn a commission when you visit links on our website.

Latest Posts

Fade a Divi Image Module Edge into the Background

Want to create a stylish fade effect on your Divi image module—where one side fades smoothly into the background? With a bit of CSS, you can make any edge (or corner) of the image fade out: top, bottom, left, right, or even diagonally.Fade a Divi Image Module Edge...

Hide the Header and Footer in the Hello Elementor Theme

Removing the default header and footer from your Hello Elementor theme allows for a streamlined and distraction-free website design. This is especially useful when creating unique landing pages, full-width layouts, or custom headers and footers with a page builder. In...

Setting up the Divi Password Box Module

Setting up password protection on a page can help you control access to sensitive or private content in WordPress, allowing only authorized visitors to view certain sections. With the Divi Password Box module, you can replace the plain Divi password form with a fully...

Open Divi Social Media Icons in a New Tab

Ensuring your website's social media icons open in a new browser tab creates a seamless user experience and keeps visitors engaged with your site while allowing them to explore your social media presence. This approach prevents users from navigating away from your...

Set Hover Color for Menu Links in the Divi Menu Module

Customizing the hover color of menu links lets you enhance the user experience and maintain visual consistency with your website’s brand. By setting a specific hover color, you can guide visitors' attention and improve navigation feedback. In this guide we show you...

Random Posts