In an Elementor Flexbox container, columns can sometimes have different widths even when the same settings are applied to each one. This most often happens when one block contains a long heading, URL, word without spaces, or an element with a large minimum width.
You can solve this issue with the CSS flex-basis property. Setting the columns’ base size to 0 and allowing text to shrink with min-width: 0 helps the browser distribute the available space more evenly. The steps below explain how to configure, test, and adapt this solution.
Why Columns Become Different Widths
Flexbox considers not only the free space in the container but also the initial size of its child elements. By default, this size may depend on the width of the internal content. As a result, a column with longer text or a wider child element receives a larger base width.
Because of this, three cards, information blocks, or feature items may look uneven. The issue becomes more noticeable on narrow screens: text may extend beyond the column or cause horizontal page scrolling.
- a long heading determines the column’s minimum width;
- a link or long word does not wrap onto a new line;
- an internal element has its own width or minimum width;
- the parent container uses the Row direction, but the widths of the child containers are not distributed evenly.
How flex-basis: 0 Works
The flex property is a shorthand for flex-grow, flex-shrink, and flex-basis. The declaration flex: 1 1 0 means that the element can grow, can shrink, and has an initial base size of zero before the available space is distributed.
The last value changes how the width is calculated. The browser relies less on the text’s initial width and distributes the available space between columns according to their flex-grow values. If all columns have the same value of 1, they receive equal portions of the row.
It is also important to add min-width: 0. In Flexbox, a child element may have an automatic minimum width that prevents it from shrinking below the width of its content. A value of 0 removes this limitation for the column itself.
- flex: 1 1 0 provides the same base size and equal distribution of available space;
- min-width: 0 allows the column to shrink within the row;
- both properties are needed for more predictable behavior on narrow screens.
Step-by-Step Elementor Configuration
First, find the parent container that holds the columns. It should be a container with the Row direction, with separate inner containers as its child elements. Add the class to the parent element itself, not to each column.
- Open the settings for the parent container in Elementor.
- In the CSS Classes field, add the class columns-equal without a period at the beginning.
- Save the changes or publish the page.
- Add the CSS in the location your site uses for custom styles, such as Elementor Custom CSS if this feature is available, or the theme’s additional styles.
- Insert the rule for the child containers.
.columns-equal > .e-con {
flex: 1 1 0;
min-width: 0;
}
What the Selector Means
The selector .columns-equal > .e-con applies only to .e-con containers that are direct child elements of the container with the columns-equal class. This helps prevent accidental changes to blocks nested deeper in the page structure.
If the columns are not direct child elements, the rule may not work. In that case, check the container structure in the Elementor Navigator and adjust the selector if necessary.
- the columns-equal class is added to the parent container;
- each column must be a child .e-con container;
- the period before the class name is required in CSS but must not be added in the CSS Classes field.
How to Check the Result
After adding the style, check the container in the editing interface and on the published page. The Elementor editor may display the result differently because of utility styles, caching, or CSS files that have not been updated.
On a wide screen, the columns should occupy approximately equal portions of the row if they do not have different margins, widths, or other restrictions. Then narrow the browser window or use developer tools to check intermediate screen sizes.
- make sure the columns remain in one row at the required width;
- check whether horizontal page scrolling appears;
- inspect long headings, URLs, buttons, and images;
- clear the plugin, CDN, or browser cache if old styles continue to appear;
- check the page on a real phone, not only in an emulator.
Configuring the Mobile Version
On mobile devices, three or four equal columns usually need to be placed one below another. To do this, leave the parent container’s direction set to Column at the mobile breakpoint in the Responsive settings.
The CSS rule for equal columns should not force the mobile container to remain horizontal. It applies to the child elements, while the direction of their parent container is determined by Elementor’s responsive settings.
- use the Row direction on desktop;
- choose Row or Column on tablet depending on the number of blocks and the screen width;
- set the direction to Column on mobile if the elements should appear vertically;
- check the spacing between columns after changing the direction, as it may increase the overall height of the section.
Common Mistakes and Limitations
Equal flex columns do not guarantee equal heights for internal blocks. Width and height are different properties: cards may have the same width but different heights because of the amount of text they contain.
CSS may also fail to resolve the issue if an internal element has a fixed width, large horizontal spacing, or the white-space: nowrap property. In this situation, inspect not only the column but also the element that is causing the overflow.
- Do not add the class only to the columns if the selector is designed for the parent container.
- Do not use the same rule for containers that are supposed to have different widths.
- Check width, min-width, max-width, and flex on child elements if the alignment does not work.
- For long URLs or words, add wrapping when necessary, for example overflow-wrap: anywhere; apply it only to the relevant text element.
- If the style does not apply, check CSS specificity and the order in which styles are loaded.
.columns-equal .elementor-heading-title,
.columns-equal a {
overflow-wrap: anywhere;
}
Frequently asked questions
Can I create equal columns without CSS?
In some layouts, using the same width settings or flex-grow values in Elementor is enough. However, flex-basis: 0 more precisely removes the influence of the content’s initial width, so the CSS solution is useful for columns with different text blocks.
Why did horizontal scrolling appear after adding flex-basis: 0?
Most often, the scrolling is caused not by the column itself but by an internal element with a fixed width, long unwrapped text, or white-space: nowrap. Check these elements and add min-width: 0 to the required container level.
Do I need to add min-width: 0 to every container?
No. Start with the direct child columns of the parent Flexbox container. Additional rules are needed only when a specific nested container or element prevents the content from shrinking.
Will this code work for older Elementor sections?
The code is designed for the structure of Flexbox containers with .e-con child elements. Older sections and columns may use a different structure and different classes, so check the selector with developer tools.
Conclusion
To equalize Elementor columns, add a class to the parent container and apply flex: 1 1 0 together with min-width: 0 to its child containers. The first property equalizes the base used for distributing space, while the second helps prevent overflow caused by long content.
Afterward, check the mobile Column direction, internal widths, long words, and cached styles separately. This check is important because the cause of horizontal scrolling may not be the column itself but one of its child elements.