Welcome again to the Divi 5 Mastery Direction. In Phase 9, we constructed the core inside pages of the coworking site. Now, it’s time to dig deeper into the Flexbox Structure Machine that helped make the ones pages imaginable.
Divi 5 brings Flexbox controls at once into the Visible Builder, so you’ll be able to arrange spacing, alignment, wrapping, and distribution with out writing customized CSS. On this put up, you’ll learn the way Flexbox works in Divi 5, what each and every main format atmosphere does, and easy methods to construct a easy responsive format the use of the ones settings.
By means of the top, you’ll perceive the principle Flexbox settings and know the way to make use of them to create cleaner, better-aligned sections throughout breakpoints.
Let’s dive in.
Contents
The Energy Of Flexbox In Divi 5
Flexbox is very best for one-dimensional layouts. That implies it arranges pieces essentially in a row or a column whilst supplying you with keep an eye on over alignment, spacing, distribution, wrapping, and order.
Right through the coworking site, Flexbox is helping energy navigation bars, characteristic rows, testimonial playing cards, pricing tables, hero content material, tournament rows, and extra. It’s particularly helpful when parts want to line up cleanly or reply gracefully because the display screen dimension adjustments.
In Divi 5, Flexbox settings are living within the Design > Structure possibility team for format parts comparable to sections, rows, columns, and teams. Those controls additionally paintings along with your Design Variables and Presets, so spacing and format possible choices can keep constant around the web page.

Flexbox Settings In The Divi 5 Interface
Make a selection a format part and cross to the Design tab. Then, make bigger the Structure possibility team to show the to be had format controls.
Here’s what each and every atmosphere does and easy methods to use it.
Structure Taste
In Divi 5, the Structure Taste atmosphere permits you to make a choice from Block, Flex, and CSS Grid, relying at the part and format you might be modifying.
Block is the extra conventional format taste. It comes in handy for more effective stacked layouts and legacy content material. Flex is the format taste we’ll center of attention on on this put up as a result of it’s superb for row-based and column-based alignment. CSS Grid is healthier for two-dimensional layouts the place you want extra keep an eye on over rows and columns on the identical time.
We’ll discover CSS Grid in additional element in Phase 11 of the Divi 5 Mastery Direction.
To paintings with Flexbox, choose Flex below Structure Taste. As soon as Flex is chosen, the Flexbox-related settings seem beneath.

Horizontal And Vertical Hole
Divi 5 contains integrated Hole controls for spacing between kid parts. As an alternative of including customized margin or padding to each module, you’ll be able to set spacing as soon as on the container stage.
Horizontal Hole controls the gap between pieces positioned facet through facet.
Vertical Hole controls the gap between pieces stacked from most sensible to backside.
Each fields toughen Complicated Gadgets, comparable to px, %, rem, and vw. You’ll additionally use Design Variables, just like the spacing values we created in Phase 3.
The usage of Horizontal and Vertical Hole is among the most simple tactics to stay spacing constant throughout rows, columns, and teams.
Structure Route
Structure Route controls the principle axis of a Flex container. In different phrases, it determines the course kid parts waft.

The to be had choices are:
- Row (default): Pieces waft horizontally from left to correct.
- Row Opposite: Pieces waft horizontally from correct to left.
- Column: Pieces waft vertically from most sensible to backside.
- Column Opposite: Pieces waft vertically from backside to most sensible.
Switching from Row to Column is among the maximum not unusual Flexbox adjustments you’ll make in Divi 5. As an example, a row of characteristic blurbs can sit down facet through facet on desktop and stack vertically on smaller displays through converting the format course on the suitable breakpoint.
Justify Content material
Justify Content material controls how pieces are disbursed alongside the principle axis of a Flex container. When the Structure Route is about to Row, it controls horizontal distribution. When the Structure Route is about to Column, it controls vertical distribution.
The to be had choices are:
- Get started: Aligns pieces to the start of the principle axis.
- Heart: Facilities pieces alongside the principle axis.
- Finish: Aligns pieces to the top of the principle axis.
- House Between: Distributes pieces with house between them and no more room on the outer edges.
- House Round: Provides house round each and every merchandise.
- House Frivolously: Provides equivalent house between pieces and on the outer edges.
One frequently used possibility is House Between. It really works neatly for headers and navigation layouts the place you need a symbol on one facet and Hyperlink modules, buttons, or different navigation parts at the different.

Align Pieces
Align Pieces controls how kid parts align alongside the cross-axis. In Row course, it controls vertical alignment. In Column course, it controls horizontal alignment.
The principle choices are:
- Get started: Aligns pieces to the beginning of the cross-axis.
- Heart: Facilities pieces alongside the cross-axis.
- Finish: Aligns pieces to the top of the cross-axis.
- Stretch: Stretches pieces around the to be had cross-axis house.
Stretch is particularly helpful for card layouts. When the father or mother container permits it, Stretch is helping kid parts fit the to be had peak, making playing cards glance extra balanced when their content material lengths range.

Structure Wrapping
Structure Wrapping determines whether or not Flex pieces keep on one line or wrap to further traces when there isn’t sufficient room.

The to be had choices are:
- No Wrap: Helps to keep pieces on a unmarried line.
- Wrap: Lets in pieces to transport to further traces when house runs out.
- Wrap Opposite: Lets in pieces to wrap within the opposite course.
Wrapping is essential for responsive design as it we could layouts adapt naturally because the to be had width adjustments. As an example, a row of playing cards can seem in more than one columns on desktop after which wrap into fewer columns on smaller displays.
Align Content material
Align Content material controls how wrapped traces align alongside the cross-axis when there’s more room within the container. It handiest turns into related when Structure Wrapping is about to Wrap or Wrap Opposite and the container has more than one traces of things.
Its choices are very similar to Justify Content material and come with Stretch, Get started, Heart, Finish, House Between, House Round, and House Frivolously.
Align Content material is most beneficial in multi-line Flex layouts. As an example, if a card format wraps to 2 or extra rows and the container has additional peak, Align Content material can keep an eye on how the ones rows sit down inside the to be had house.

Construction A Structure With Flexbox
Now, let’s use those Flexbox settings to create a easy three-column format. Get started through including a brand new three-column Row to a web page. Within the Design tab, make bigger the Structure possibility team and ensure that Flex is chosen within the Structure Taste dropdown.

Set The Row Hole
Subsequent, alter the Horizontal and Vertical Hole for the Row. Hover over the Horizontal Hole box to show the Insert Dynamic Content material icon.

Make a selection the Spacing – Medium variable from the checklist and follow it.

Repeat the similar procedure for the Vertical Hole box.
Taste The Columns
Subsequent, upload spacing and border kinds to each and every Column. Get started through modifying the primary Column.

Cross to the Design tab and make bigger the Spacing possibility team. Click on the Hyperlink icon within the Padding box so all 4 facets keep hooked up. Then, use the Insert Dynamic Content material icon to use the Spacing – Small variable to the padding price.
Subsequent, hover over the Border possibility team to show the Assign Presets icon. Assign the Defined – Darkish Possibility Staff Preset.
Replica Column Types With Attributes
Now that the primary Column has the right kind spacing and border kinds, use Divi’s right-click Attributes menu to use the ones kinds to the rest Columns.
Proper-click the primary Column within the canvas and choose Replica Attributes.

Subsequent, right-click the second one Column. When the Attributes menu seems, choose Paste Attributes, then make a choice Paste Column Design Attributes. This copies the design-related kinds from the primary Column and applies them to the second one.
In spite of everything, right-click the 3rd Column and paste the similar design attributes once more.

Upload Content material To The Columns
Now, upload content material to the primary Column. Get started with a Module Staff. Throughout the Staff, upload two Heading modules, one Textual content module, and one Divider module.
Out of doors the Staff, however nonetheless throughout the first Column, upload an Icon Checklist module and a Button module. Use the Presets and Variables created previous within the path to stay the design constant.
Fill the rest Columns with identical content material. Ahead of making use of extra Flexbox settings, the format must glance very similar to the picture beneath.

Regulate Staff And Column Gaps
Get started through adjusting the vertical spacing inside of each and every Staff. Open the primary Column’s Staff module and cross to the Design tab. Increase the Structure possibility team and follow the Spacing – XSmall variable to the Vertical Hole box. Repeat the similar procedure for the rest Teams.

Subsequent, open the primary Column’s settings and cross to the Design tab. Increase the Structure possibility team and follow the Spacing – Small variable to the Vertical Hole box. Repeat the similar procedure for the rest Columns.

Align The Buttons
At this level, the highest of the format is aligned, however the Button modules on the backside of each and every Column would possibly not line up for the reason that content material lengths range. To mend that, alter the Justify Content material atmosphere at the Columns that want it.
Within the first Column, set Justify Content material to House Between. This helps to keep the Staff module on the most sensible of the Column whilst pushing the Button module to the ground.
Repeat the similar adjustment for the 3rd Column. As soon as House Between is carried out the place wanted, the Button modules align extra constantly around the Row.

Make Responsive Changes
Ahead of completing the format, test the way it responds throughout other display screen sizes. Divi 5 offers you a number of gear for this, together with Construction Templates, Customizable Responsive Breakpoints, and the Responsive Editor.
If you wish to take a look at extra display screen widths, open the breakpoint controls within the Best Bar and permit the extra breakpoints you want. Divi 5 helps as much as seven customizable breakpoints.
Subsequent, open the Row containing the three-column format. Cycle in the course of the energetic breakpoints to peer how the format behaves. When a breakpoint wishes adjustment, use Observe Construction Template within the Components possibility team to modify the Row construction for that display screen dimension.
You’ll additionally use the Responsive Editor to regulate Column alignment when the Columns stack vertically. Open the primary Column’s settings, cross to the Design tab, and make bigger the Structure possibility team.
Hover over the Align Pieces box to show the Edit Responsive Values icon. Make a selection it and set Align Pieces to Heart on the related breakpoint. Repeat the similar procedure for the rest Columns.
High-quality-Music Column Widths
After the Columns are aligned, you might have considered trying extra keep an eye on over their widths. As an example, on the Pill Vast breakpoint, the stacked format would possibly depart extra white house than you need.

To regulate a Column’s width, open the Column settings and cross to the Design tab. Increase the Sizing possibility team and find the Column Magnificence box. Click on the dropdown caret throughout the box to show the choices.

Make a selection 1/2 from the to be had choices.
Reorder Components Responsively
Once in a while, the visible order you need on desktop isn’t superb on cell. Divi 5 permits you to alter show order from the Order possibility team.
Click on into the 3rd Column within the format. Increase the Order possibility team to show the Show Order box.

Atmosphere the sector to -1 strikes the 3rd Column previous within the Row’s visible order on the breakpoint the place that price is carried out.
Guidelines And Absolute best Practices
Now that you’ve got constructed a Flexbox format, listed here are a couple of tactics to paintings sooner and get extra predictable leads to Divi 5.
Get started With Hole Controls
Use Horizontal Hole and Vertical Hole prior to including customized margins to person modules. Atmosphere spacing on the container stage creates extra constant rhythm throughout rows, columns, and teams.

Use House Between For Card Layouts
Justify Content material > House Between comes in handy when you need content material to sit down on the most sensible of a card and a button to stick aligned close to the ground. This works particularly neatly when playing cards have other quantities of textual content.

Use Stretch For Equivalent-Peak Playing cards
For equal-height parts, comparable to characteristic blurbs, pricing playing cards, or carrier playing cards, use Align Pieces > Stretch at the father or mother container when suitable. This may lend a hand kid parts percentage a constant peak.

Use Design Variables For Spacing
Mix Flexbox settings with the Design Variables you created previous within the path. When hole, padding, and width values reference variables, format updates are more straightforward to regulate later.

What’s Coming Subsequent
On this a part of the Divi 5 Mastery Direction, you realized how Flexbox controls spacing, alignment, course, wrapping, and distribution inside of Divi 5. You additionally constructed a three-column format that makes use of hole controls, Design Variables, Characteristic Control, responsive construction adjustments, and show order.
Subsequent, in Phase 11, we’ll discover two-dimensional layouts with CSS Grid. You’ll be told when Grid is a greater have compatibility than Flexbox and the way the 2 techniques paintings in combination for contemporary internet design.
If in case you have now not already, obtain the newest model of Divi 5, discover Flexbox, and get started construction. Tell us what you suppose through leaving a remark beneath or attaining out on our social media channels.
The put up Phase 10: Mastering Flexbox In Divi 5 gave the impression first on Sublime Topics Weblog.
WordPress Web Design
