Part 1 Of Mastering Flexbox: Understanding The Core Controls In Divi 5

by | Jul 1, 2026 | Etcetera | 0 comments

One of the vital precious enhancements in Divi 5 is its local Flexbox reinforce. It offers you blank, visible keep watch over over structure construction immediately within the Visible Builder, lowering the desire for customized CSS, duplicated sections, or handbook spacing workarounds.

That is the primary a part of our Mastering Flexbox collection. During the collection, we’ll introduce Flexbox in Divi 5, discover its settings intimately, and display how other controls paintings in combination to create useful, responsive designs. In Phase 2, we’ll display you how one can create equal-height playing cards with aligned buttons.

On this first section, we’ll center of attention at the settings to be had within the Structure possibility staff when Flex is chosen. Those controls have an effect on how kid components go with the flow, wrap, align, and distribute house inside of a guardian container, making them probably the most maximum vital structure gear you’ll use in Divi 5.

Let’s dive in.

What Is Flexbox In Divi 5?

Flexbox (Versatile Field Structure) is a CSS structure type designed to organize, align, and distribute house between pieces inside of a container, even if the ones pieces have other or dynamic sizes.

Earlier than Divi 5, developing balanced layouts in Divi incessantly supposed depending at the conventional phase > row > column construction, then fine-tuning spacing with margin, padding, or customized CSS. That means labored, however it might make responsive alignment more difficult to regulate throughout breakpoints.

Divi 5 adjustments this by means of bringing local Flexbox controls immediately into the Visible Builder. As an alternative of writing CSS for not unusual structure habits, you’ll be able to organize route, spacing, wrapping, alignment, and ordering visually.

Key Advantages Of Flexbox In Divi 5

Visible Structure Controls: Flexbox controls are positioned within the Structure possibility staff within the Design tab. Relying at the component you’re enhancing, you’ll be able to use them on sections, rows, columns, and modules that act as bins.

flexbox settings in Divi 5

Responsive Layouts With out Customized CSS: You’ll be able to alter Flexbox settings throughout desktop, pill, and cellular breakpoints, serving to layouts adapt naturally with out duplicating content material or writing customized media queries.

Works Throughout Boxes And Modules: Flexbox isn’t restricted to rows and columns. You’ll be able to practice Flexbox habits to supported components all over the Visible Builder, together with Module Groups, Blurbs, Buttons, and different module-based layouts.

Flexbox on module groups

An Evaluate Of Flexbox Settings In Divi 5

Maximum Flexbox controls are living within the Structure possibility staff, however two spouse options out of doors that staff are particularly helpful when development responsive Flex layouts:

Column Elegance

The Column Elegance dropdown within the Sizing possibility staff permits you to keep watch over person column widths inside of a Flex row. As an example, you’ll be able to set a column to span 1/3 width on desktop, 1/2 width on pill, and whole width on cellular.

divi 5 column class

Show Order

Divi 5 comprises visible ordering controls within the Order settings of a person column’s Content material tab. This is helping you keep watch over responsive stacking patterns with out duplicating sections.

As an example, alternating desktop sections corresponding to Textual content-Symbol / Symbol-Textual content can stack awkwardly on smaller monitors, now and again striking pictures back-to-back.

Via adjusting the numeric Show Order series in line with breakpoint, you’ll be able to keep watch over the visible stack whilst preserving one blank structure construction.

Beneath is a breakdown of the foremost Flexbox settings within the Structure possibility staff, with explanations and sensible examples.

Structure Possibility Workforce

The Structure possibility staff is the place you’ll spend maximum of your time when running with Flexbox in Divi 5. As soon as you choose Flex because the Structure Taste, the builder unearths controls that map to local CSS Flexbox habits.

flex controls on columns

Horizontal & Vertical Hole

Hole is the cleanest approach so as to add constant house between flex pieces. As an alternative of including margin to each and every merchandise in my opinion, you’ll be able to practice spacing as soon as on the guardian stage.

Horizontal Hole controls the horizontal house between flex pieces.

Vertical Hole controls the vertical house between stacked pieces or wrapped strains.

You’ll be able to use Divi 5’s Advanced Units, together with px, %, em, rem, vw, clamp(), calc(), and extra, to create fluid, responsive spacing values.

divi 5 advanced units

You’ll be able to additionally use Divi 5’s Variable Generator to create a fluid sizing machine. That makes it more straightforward to reuse constant spacing values throughout gaps, padding, margins, and different numeric design settings.

divi 5 variable generator

Tip: Get started with small hole values and build up them are living within the builder. You’ll see how temporarily constant spacing improves the rhythm of a structure.

Structure Path

Structure Path determines the route during which kid components go with the flow inside of a flex container. Beneath the hood, this maps to the CSS flex-direction belongings.

See also  Divi Goes to WordCamp Asia 2024 (Community Update)

Row and Row Opposite permit pieces to go with the flow horizontally.

layout direction row

Column and Column Opposite permit pieces to go with the flow vertically.

layout direction column

Converting the structure route additionally adjustments how alignment settings behave, since the primary axis and move axis alternate with it. You’ll be able to alter Structure Path in line with breakpoint, which turns out to be useful when you need a horizontal desktop structure to stack vertically on cellular.

As an example, many cellular layouts will have to stack vertically. On the other hand, some small components, corresponding to weblog publish class tags or social media icons, incessantly paintings higher once they stay horizontal.

As noticed within the screenshot beneath, surroundings the guardian Workforce module to handle a horizontal Row route on the cellular breakpoint assists in keeping publish tags aligned side-by-side as a substitute of stacking right into a vertical checklist.

layout direction example

Figuring out The Flexbox Axes

Earlier than you alter alignment, it is helping to know one core Flexbox idea: the principle axis and move axis alternate while you alternate route.

In a Row, the principle axis runs horizontally, so pieces go with the flow left to appropriate by means of default. In a Column, the principle axis runs vertically, so pieces go with the flow peak to backside by means of default.

To make this totally visible, have a look at how the go with the flow of components adjustments between the 2 number one instructions:

Main Axis vs Cross Axis

Justify Content material

If you’ve selected a route, Justify Content material controls how pieces distribute alongside the principle axis.

Get started

This feature puts pieces originally of the principle axis. In a Row structure, content material begins at the left in an ordinary left-to-right structure. In a Column structure, pieces get started on the peak. Use this as a baseline for same old textual content blocks, weblog feeds, and easy content material teams.

justify content start

Middle

This feature gathers pieces towards the middle of the principle axis, leaving final house on each side. It really works neatly for hero content material, targeted calls to motion, and emblem or icon rows.

justify content center

Finish

This feature puts pieces on the finish of the principle axis. In a horizontal row, pieces transfer towards the fitting edge in an ordinary left-to-right structure. In a vertical column, pieces transfer towards the ground. Use it for right-aligned button teams, compact navigation layouts, or footer content material that wishes to sit down on the finish of its container.

justify content end

House Between

This feature distributes pieces from edge to edge. The primary merchandise sits at first of the container, the last thing sits on the finish, and the remainder house is sent between the pieces. It’s particularly helpful for header menus and layouts the place reverse ends wish to keep anchored.

justify content space between

House Round

This feature provides house round each and every merchandise. As a result of each and every merchandise receives house on each side, the gaps between interior pieces appear bigger than the distance on the outer edges. Use it when you need a looser, extra open structure.

justify content space around

House Calmly

This feature creates equivalent house between all pieces and the outer edges of the container. In contrast to House Round, the periphery spacing suits the spacing between pieces. Use it for balanced icon rows, function lists, or lightly allotted navigation pieces.

justify content space evenly

Align Pieces

Whilst Justify Content material controls alignment alongside the principle axis, Align Pieces controls alignment alongside the move axis. In a Row structure, that normally method vertical alignment. In a Column structure, that normally method horizontal alignment.

Get started

This feature aligns pieces to the start of the move axis. In an ordinary horizontal row, pieces line up alongside the highest fringe of the container. Use it for text-heavy layouts or mixed-media grids the place a constant peak baseline issues.

align items start

Middle

This feature facilities pieces alongside the move axis. It’s particularly helpful when aligning a picture subsequent to textual content, centering buttons beside replica, or balancing mixed-height modules inside of the similar row.

align items center

Finish

This feature aligns pieces to the tip of the move axis. In a horizontal row, pieces align alongside the ground fringe of the container. This turns out to be useful when more than one pieces wish to percentage a grounded visible baseline.

align items end

Stretch

This feature stretches flex pieces around the to be had cross-axis house when their measurement lets in it. It turns out to be useful for card grids, pricing sections, and layouts the place columns or playing cards wish to seem visually equivalent in peak.

align item stretch

The important thing distinction between Justify Content material and Align Pieces is that Justify Content material works alongside the principle axis, whilst Align Pieces works alongside the move axis. The visual outcome adjustments relying on whether or not your Structure Path is Row or Column.

Tip: Use Stretch when you need playing cards or modules to percentage a constant peak. Use Finish when pieces wish to align alongside the ground edge. For pricing tables with buttons aligned on the backside, mix equal-height playing cards with interior Flexbox settings inside of each and every card.

align items example

Structure Wrapping

Structure Wrapping controls whether or not flex pieces keep on one line or transfer onto further strains when there isn’t enough space.

No Wrap

This default habits assists in keeping all pieces on one flex line. Relying at the merchandise settings and to be had house, pieces would possibly shrink, overflow, or develop into too compressed. Use No Wrap deliberately for compact button bars, horizontal toolbars, or layouts that are supposed to stay on a unmarried line.

default wrap settings in Divi 5

Wrap

This feature lets in pieces to transport onto a brand new line once they outgrow the to be had width. It is without doubt one of the most dear settings for responsive card grids, testimonial sections, function rows, and tag clouds.

Layout wrapping in Divi 5

Wrap Opposite

This feature lets in pieces to wrap, however reverses the route during which new flex strains are positioned alongside the move axis. It does now not opposite the order of each person merchandise; as a substitute, it adjustments the place the wrapped strains seem. Use it while you deliberately want wrapped strains to stack in the other way.

See also  How one can Get Colour Codes on Mac With out 3rd-Celebration Equipment

wrap reverse

Align Content material

Align Content material controls how more than one flex strains distribute alongside the move axis. This surroundings most effective has a visual impact when Structure Wrapping is enabled, the pieces wrap onto more than one strains, and the container has further cross-axis house.

The to be had choices replicate your core distribution settings however practice to complete strains as a substitute of person pieces.

Stretch

This feature stretches wrapped strains to fill to be had cross-axis house. Use it when you need multi-row card grids or wrapped layouts to really feel extra lightly allotted.

multi line stretch alignment in Divi 5

Get started

This feature teams wrapped strains originally of the move axis, leaving more room on the finish. It turns out to be useful for same old multi-line grids the place content material will have to keep anchored close to the highest.

multi line start alignment in Divi 5

Middle

This feature facilities the wrapped strains within the to be had cross-axis house. Use it when a wrapped structure wishes a balanced presentation inside of a taller container.

multi line center alignment in Divi 5

Finish

This feature puts wrapped strains on the finish of the move axis, leaving more room earlier than them. It really works neatly for bottom-aligned structure sections or structural footer components.

multi line end alignment in Divi 5

House Between

This feature puts the primary wrapped line at first, the ultimate wrapped line on the finish, and distributes the remainder house between the strains. It turns out to be useful when you need wrapped rows to occupy the whole peak of a container.

multi line space between alignment in Divi 5

House Round

This feature provides house round each and every wrapped line. The gap between interior strains seems better than the distance on the outer edges as a result of each and every line receives house on each side.

multi line space around alignment in Divi 5

House Calmly

This feature creates equivalent spacing between each wrapped line and the outer edges of the container. Use it when your structure wishes constant, symmetrical spacing from peak to backside.

multi line space evenly alignment in Divi 5

Easy difference:

  • Align Pieces aligns person pieces inside of each and every flex line.
  • Align Content material aligns the flex strains themselves when content material wraps onto more than one strains.

Within the instance beneath, Structure Wrapping is enabled with Align Content material set to House Between.

align content

How Those Controls Paintings In combination

Figuring out each and every Flexbox surroundings in my opinion is beneficial, however the actual energy comes from combining them. Flexbox is perfect for one-dimensional layouts, the place you basically keep watch over pieces alongside a row or a column. For strict two-dimensional layouts that require detailed row and column placement on the identical time, CSS Grid could also be a greater have compatibility.

Beneath are 5 sensible examples that display how Divi 5 Flexbox settings paintings in combination in actual layouts.

1. Easy Horizontal Card Row

A not unusual use case for Flexbox is developing rows of function playing cards, testimonials, pricing tables, or blurbs.

On this instance, the guardian row makes use of a Horizontal Hole and Vertical Hole of 20px to create constant house between the playing cards. Structure Wrapping is about to Wrap, so playing cards can transfer to new strains when there isn’t enough room. Align Content material is about to Stretch to lend a hand the wrapped rows fill the to be had house extra lightly.

On the column stage, each and every card makes use of the Column Elegance surroundings: 1/3 on desktop for 3 columns, 1/2 on pill for 2 columns, and Fullwidth on cellular for a single-column stack.

This mixture creates a blank, balanced, and reusable responsive card structure.

blurb layout with layout wrapping in Divi 5

2. Primary Content material Structure With A Vertical Sidebar

This two-column structure includes a narrower sidebar at the left and a much broader content material house at the appropriate, which fits neatly for weblog posts, documentation pages, and useful resource layouts.

The principle row makes use of a percentage-based horizontal hole and switches from Row to Column on smaller monitors for a herbal stacked revel in. The sidebar makes use of nested Module Teams with Row route and small Horizontal Gaps to prepare textual content hyperlinks and buttons. One button staff makes use of Justify Content material: Finish to push the buttons to the a ways fringe of its container.

The principle content material column makes use of Vertical Hole settings and nested Teams with wrapping rows of buttons and content material blocks. This presentations how Flexbox can also be carried out at more than one ranges, from row to column to module staff, to create arranged layouts with out customized CSS.

a blog post layout in Divi 5

3. Hero Phase

Hero sections are one of the vital vital portions of a homepage, and Flexbox makes it more straightforward to stability textual content, buttons, imagery, and supporting stats.

This case makes use of two stacked rows inside of a piece. The primary row comprises two columns and makes use of Align Pieces: Middle so the textual content and visible content material align vertically. The left column additionally makes use of a 15px Vertical Hole to create constant spacing between the heading, replica, and buttons.

The second one row comprises six Quantity Counter modules. On desktop, the column makes use of Structure Path: Row and Justify Content material: House Between to unfold the counters around the to be had width. On smaller monitors, Structure Wrapping lets in the counters to wrap into more than one strains whilst keeping up balanced spacing.

The result’s a hero structure with targeted content material, constant spacing, and responsive statistics that stay simple to scan.

hero section created in Divi 5

4. Pricing Tables

Pricing tables are a powerful Flexbox use case as a result of they incessantly want equal-height playing cards, aligned content material, and constant spacing between plans.

On this instance, a unmarried row comprises 4 pricing columns. On the row stage, a 20px Horizontal Hole creates blank separation between playing cards, whilst Align Pieces: Stretch is helping the columns percentage a constant peak when their settings permit it.

Inside of each and every pricing column, nested Module Teams take care of the interior structure. The highest staff makes use of a small Vertical Hole for the plan identify and value house. The fee phase makes use of Structure Path: Row and Align Pieces: Middle to align the forex image and value at the identical line.

See also  9 Best AI Content Detectors in 2023 (Future Proof Your Content)

To stay buttons aligned on the backside, use an interior vertical structure inside of each and every card and distribute the cardboard content material deliberately, reasonably than depending most effective at the guardian row. This assists in keeping each and every pricing plan balanced even if function lists have other lengths.

pricing table layout built with Divi 5

5. Tag Cloud

Tag clouds are an effective way to show many hyperlinks or subjects in a compact, visually attractive layout.

On this instance, a unmarried column comprises 15 Textual content modules styled as colourful tags. On the Textual content module stage, each and every tag makes use of Structure Path: Row Opposite, Justify Content material: Middle, and a small 10px Horizontal Hole. This assists in keeping the tag label and icon aligned as a compact horizontal unit.

On the Column stage, a good 8px Horizontal Hole and 8px Vertical Hole are carried out, with each Justify Content material and Align Pieces set to Middle. Structure Wrapping is enabled so the tags can go with the flow onto more than one strains, and Align Content material is about to House Between to distribute the wrapped rows within the to be had house.

The result’s a dynamic tag cloud that wraps cleanly and avoids awkward gaps.

tag cloud example

Obtain And Set up The Recordsdata

That will help you perceive the whole lot lined on this publish, we’ve created a to hand Flexbox settings information you’ll be able to reference. It gifts the Flexbox settings visually and comprises a couple of phase layouts that will help you get began.

To make use of the information, fill out the shape beneath to obtain the ZIP document. As soon as downloaded, pass to the WordPress dashboard, click on Divi > Divi Library, and choose the Import & Export button.

accessing the Divi Library

Click on the Import tab, find the Mastering Flexbox Settings JSON document in your pc, and choose Import Divi Builder Layouts.

Import Divi Builder Layouts

From there, create and open a brand new web page within the Visible Builder. Click on the blue + icon on the peak of the Builder Bar within the left sidebar.

import a saved layout into Divi

When the Insert Structure modal seems, choose Stored Structure from the to be had choices.

insert a layout in the Visual Builder

Make a choice the Mastering Flexbox Settings structure to import it into the Canvas.

Get Began With Flexbox In Divi 5

With a transparent figuring out of the core Flexbox settings in Divi 5, you’ll be able to construct cleaner, extra responsive layouts immediately within the Visible Builder. Via combining Structure Path, Hole, Justify Content material, Align Pieces, Structure Wrapping, Align Content material, Column Elegance, and Show Order, you’ll be able to create the whole lot from easy card rows to complex nested layouts.

In the event you’d love to take your Flexbox talents additional, proceed with Phase 2 of our Mastering Flexbox collection. We’ll display you how one can create polished card layouts the place content material and buttons align persistently throughout each card.

In the event you haven’t already, download the latest version of Divi 5, import the Flexbox settings information, and get started experimenting with Flexbox to your personal initiatives. The extra you utilize those controls, the extra herbal they’ll really feel. Drop a remark beneath or succeed in out to us on our social media channels to tell us which Flexbox surroundings you’re maximum excited to make use of.

The publish Part 1 Of Mastering Flexbox: Understanding The Core Controls In Divi 5 seemed first on Elegant Themes Blog.

WordPress Maintenance Plans | WordPress Hosting

read more

0 Comments

Submit a Comment

DON'T LET YOUR WEBSITE GET DESTROYED BY HACKERS!

Get your FREE copy of our Cyber Security for WordPress® whitepaper.

You'll also get exclusive access to discounts that are only found at the bottom of our WP CyberSec whitepaper.

You have Successfully Subscribed!