All Collections
FAQ's and Troubleshooting
How to customize the width of Divi columns
How to customize the width of Divi columns

Customize the default width of Divi columns using custom CSS code.

Eduard Ungureanu avatar
Written by Eduard Ungureanu
Updated over a week ago

To customize the width of any Column inside Divi, we need to keep in mind a few things:

  1. The size of each Column depends on the Gutter size - the default value is 3 - which means each Column will have a space of 5.5%.

  2. The size of each Column also depends on the column layout a Row has.

Example:

The Row's column layout is set to be 2 Columns with the default Guter size. That means each Column will have a width of 47.25%. The value is calculated as follows:

(Row's Width - (Number of columns - 1 * Gutter width)) / Number of columns.

The Row's width is always considered to be 100%. So, in the above example, each column width will be:

  • 2 Columns layout: (100 - (2 - 1 * 5.5))/2 = 47.25%

  • 3 Columns layout: (100 - (3 - 1 * 5.5))/3 = 29.6667%

Customize the default column's width

  1. Open the Row's settings

  2. Open the Column's setting (for which we need to change the width)

  3. Go to Advanced Tab → Custom CSS → Module Elements → Main Element.

  4. Add the following CSS rule: width: 47.25%;

    Set custom width value on a column

Note: In the example above, I set the width of a column to be the same as that of a column inside a two-column layout. Make sure to adjust the width to fit your needs.

Example:

The goal is to have a two-column layout, where the first Column is 70% and the second Column's width is the remaining space.

  1. Insert a Row in the layout.

  2. Choose the Row's layout to be 2 columns.

  3. Open the settings of the first Column and go to Advanced Tab → Custom CSS → Module Elements → Main Element.

  4. Set the width to 70 - 5.5 - because the gutter width default value is 5.5% - that means the actual width for the first column will be: 64.5%

    First column's width

  5. Open the settings of the second Column and go to Advanced Tab → Custom CSS → Module Elements → Main Element.

  6. Set the width to 30%.

    Second column's width

  7. Ensure that for each width properties the !important flag is being used to override the default column width.

The result:

Custom column widths

Pro tip: Always keep in mind the size of the gutter (the space between columns) when calculating the correct width value of each Row.

Did this answer your question?