In Phase 3 of our Mastering Flexbox sequence, we explored Format Wrapping, the diversities between Wrap and No Wrap, how Align Content material impacts wrapped multi-line layouts, and the way Wrap Opposite and Show Order can make stronger responsive waft.

On this fourth installment, we’ll center of attention on one of the crucial commonplace structure demanding situations in internet design: aligning content material with out depending on hidden spacers, guide spacing hacks, or customized CSS.

Ahead of Divi 5, designers steadily used empty Divider modules, guide padding, margins, or customized CSS to push content material into position, create visible steadiness, or power parts to align within equal-height boxes. The ones strategies labored, however they added additional construction, required extra breakpoint-specific cleanup, and made layouts tougher to handle.

Divi 5 offers you a cleaner visible workflow. With Flexbox controls reminiscent of Justify Content material, Align Pieces, Align Content material, and Hole, plus supporting equipment like Develop To Fill, Module Teams, and Nested Modules, you’ll align content material without delay within the Visible Builder with a long way much less customized code.

Let’s dive in.

Why Conventional Alignment Strategies Fall Brief

Ahead of Divi 5, exact vertical or horizontal alignment steadily required workarounds. One of the crucial maximum commonplace tactics incorporated:

  • The use of hidden Divider modules to push content material down or create synthetic house.
  • Including customized CSS to vertically middle or bottom-align content material within equal-height columns.
  • Depending on guide padding and margin values that wanted consistent adjustment throughout breakpoints.

The ones approaches may remedy the rapid visible drawback, however in addition they made layouts extra fragile. If a headline modified, a button label wrapped, or a bit switched to a smaller breakpoint, the structure steadily wanted some other spherical of spacing changes.

With Divi 5’s local Flexbox Format Machine, alignment may also be treated on the container degree. Gear like Justify Content material, Align Pieces, Hole, and Develop To Fill permit you to create balanced layouts that reply extra naturally to actual content material.

Divi 5 Flexbox Layout System

Core Alignment Gear You’ll Use Maximum

Maximum Flexbox alignment controls reside within the Format choice crew. A very powerful ones to grasp are Justify Content material, Align Pieces, Align Content material, and Hole.

Justify Content material distributes kid parts alongside the primary axis. In a Row course, that generally approach horizontal distribution. In a Column course, that generally approach vertical distribution. Its choices, together with Get started, Middle, Finish, House Between, House Round, and House Flippantly, permit you to keep watch over how content material is located within its dad or mum container.

Justify Content in Divi 5

Align Pieces controls alignment alongside the pass axis. In a Row structure, this generally impacts vertical alignment. In a Column structure, it generally impacts horizontal alignment. The to be had choices, Get started, Middle, Finish, and Stretch, are helpful for centering pieces, aligning edges, or stretching pieces when their sizing lets in it.

Align Items in Divi 5

When Format Wrapping is enabled and content material flows onto more than one traces, Align Content material controls how the ones wrapped traces are dispensed alongside the pass axis. This environment most effective has a visual impact when there are more than one flex traces and the dad or mum container has more room to distribute, reminiscent of an outlined or minimal top.

Align Content in Divi 5

Those alignment equipment transform much more tough when blended with Horizontal Hole and Vertical Hole for constant spacing, Develop To Fill within the Sizing choice crew for versatile merchandise expansion, Module Teams for grouping comparable modules, and Nested Modules for growing unbiased alignment contexts within modules.

Alignment Examples Constructed With Divi 5

To turn how those equipment paintings in combination, let’s stroll thru a couple of sensible alignment examples and the settings utilized in each and every one.

1. Navigation Menu

Flexbox alignment - navigation

Function: Construct a header navigation the place the brand and menu hyperlinks sit down at the left, the CTA buttons sit down at the appropriate, and the whole lot remains vertically focused.

Settings Used: The structure makes use of a single-column row. On the column degree, Justify Content material is about to House Between, Align Pieces is about to Middle, and the Horizontal Hole is about to 20px. The primary Module Team, containing the brand and navigation hyperlinks, makes use of Justify Content material > House Between and Align Pieces > Middle. The second one Module Team, containing the 2 buttons, makes use of Justify Content material > Finish, Align Pieces > Middle, and a 10px Horizontal Hole so the buttons sit down well side-by-side.

This mix creates a balanced navigation header with out hidden spacing modules or guide margin changes between each and every component.

2. Hero Segment

Flexbox alignment - Hero section

Function: Create a blank hero phase the place the content material stacks vertically, spacing remains constant, and the 2 CTA buttons sit down side-by-side.

Settings Used: The dad or mum row makes use of Align Pieces > Stretch. On the column degree, Align Pieces and Justify Content material are each set to Get started, with a 20px Vertical Hole carried out between kid parts. A Module Team wraps the 2 buttons the use of Format Path > Row and a 15px Horizontal Hole, protecting them aligned horizontally with constant house between them.

This way offers you predictable spacing from the dad or mum container as a substitute of depending on additional Divider modules or one-off padding values.

3. Statistics Grid

Flexbox alignment - statistics

Function: Show 4 key metrics in a responsive grid the place each and every stat card feels focused, balanced, and simple to scan.

Settings Used: This phase makes use of a four-column row with Format Wrapping > Wrap and Column Elegance > 1/2 on each and every column, making a two-by-two grid. The row makes use of 20px Horizontal Hole and 20px Vertical Hole to keep watch over spacing between the playing cards. On the column degree, Justify Content material and Align Pieces are each set to Middle. Every column additionally makes use of 20px Padding on all 4 facets within the Spacing choice crew to create respiring room within each and every card.

Hole handles spacing between playing cards, whilst padding handles spacing within each and every card. Preserving the ones two roles separate makes the structure more uncomplicated to regulate throughout breakpoints.

4. Provider Playing cards

Flexbox alignment - service cards

Function: Create a provider phase the place the headline row aligns cleanly and each and every provider card helps to keep its button located persistently, even if textual content lengths range.

Settings Used: The highest row makes use of two columns with Column Elegance > 1/2 and Align Pieces > Finish on the row degree to align the content material towards the ground edge. Every column additionally makes use of Align Pieces > Stretch so its interior parts can fill the to be had width.

The second one row comprises six columns with Format Wrapping > Wrap and Column Elegance > 1/2. The row makes use of Align Pieces > Get started. Within each and every provider card, the Heading module makes use of a Nested Module for the supporting textual content, paired with a 10px Horizontal Hole for spacing. Develop To Fill is enabled the place the content material house wishes to soak up more room, serving to the button keep aligned close to the ground of each and every card.

This method turns out to be useful for card layouts the place textual content lengths range however the CTA place wishes to stay constant.

5. Blended-Width Spotlight Segment

Flexbox alignment - Mixed Width

Function: Construct a spotlight house that mixes a big featured content material block, a statistic card, and smaller supporting containers whilst protecting the structure visually balanced.

Settings Used: This phase makes use of a row with combined column spans and Format Wrapping. The row has each Horizontal Hole and Vertical Hole set to 30px. On the dad or mum degree, Align Pieces > Stretch is helping columns proportion a constant row top when their sizing lets in it. One column makes use of Justify Content material > House Between to distribute its interior content material from height to backside, whilst the opposite columns use Get started. A 15px Vertical Hole on each and every column controls spacing between modules, and each and every column additionally applies 20px Padding on all 4 facets for interior respiring room.

This mix creates a extra dynamic structure whilst protecting spacing, alignment, and interior construction more uncomplicated to control.

6. Procedure Steps

Flexbox alignment - process steps

Function: Construct a four-step How It Works procedure structure the place icons, step numbers, headings, and supporting textual content keep structured and aligned throughout columns.

Settings Used: This phase makes use of a two-column row with Column Elegance > 1/2 and Format Wrapping > Wrap enabled. Every column has 10px Padding on all 4 facets for interior spacing. On the column degree, Align Pieces > Stretch and Justify Content material > Get started are carried out.

Within each and every column, a Module Team wraps the icon and step quantity. This crew makes use of Format Path > Row, Justify Content material > House Between, and Align Pieces > Middle, protecting the icon and massive quantity aligned at the identical horizontal line.

This setup creates a structured procedure phase with out additional spacer modules.

Step-By means of-Step Construct Walkthrough

Let’s stroll thru methods to construct a three-column crew member card phase the use of local Flexbox alignment equipment, with Spacing used most effective the place it helps interior padding or visible respiring room.

Step 1: Create The Mum or dad Row

Upload a brand new three-column row. Make a selection Flex because the Format Taste if it isn’t already decided on. Set the row to Format Wrapping > Wrap if you happen to plan so as to add greater than 3 crew contributors later. This permits further columns to transport onto new flex traces as a substitute of requiring additional rows.

Subsequent, set the Horizontal Hole and Vertical Hole to 20px for constant spacing between columns.

set horizontal and vertical gaps

Open the primary column’s settings. Within the Content material tab, assign a Background Colour.

assign a background color in Divi 5

Within the Format choice crew, set the Vertical Hole to 0px. This eliminates computerized spacing between the column’s direct kid parts so the cardboard construction may also be managed extra deliberately with interior Module Teams.

column vertical gap

Use the Border choice crew so as to add a Border Radius, Border Taste, Border Width, and Border Colour to the column.

column border styles

Go back to the row and make a selection the Content material tab. Within the Parts choice crew, right-click the primary column, reproduction its merchandise kinds, and paste the ones kinds onto the remainder columns.

Step 2: Upload The Content material

Upload an Symbol module to the primary column. Within the Design tab, increase the Sizing choice crew and set the Facet Ratio to 1:1. This frames the picture as a sq..

using Aspect Ratio in Divi 5

Subsequent, increase the Framing choice crew. Alternate Object Have compatibility from the default Have compatibility solution to Quilt. Use the Object Place picker to select which a part of the picture must stay visual throughout the sq. body.

Subsequent, upload a Module Team and a Heading module to the primary column.

Within the Team’s Design tab, open the Format choice crew and set a 15px Vertical Hole. Then open the Spacing choice crew and upload 20px Padding to all 4 facets.

Upload a Textual content module as a nested component within the primary Heading module.

add nested elements in Divi 5

Nested Modules mean you can position modules within different modules, turning the dad or mum module right into a structure container. This offers you some other degree of keep watch over over alignment, spacing, and interior construction.

Subsequent, upload a brand new Module Team with 3 Textual content modules under the opposite modules within the column. Taste them as wanted, then modify the Team’s Flexbox settings. Within the Format choice crew, set the Horizontal Hole and Vertical Hole to 8px. Use Row for the Format Path and allow Format Wrapping so the tags can waft onto further traces when wanted.

adjust flexbox settings on Module Groups in Divi 5

To complete the column, upload some other Module Team. Use the Layers panel to verify it’s nested throughout the Major Team.

nested module groups

Throughout the ultimate Team, upload a Social Media Apply module and a Textual content module, then taste them. Set the Team’s Format Path to Row and Justify Content material to House Between.

group module flexbox settings

Alignment may also be managed on the module degree, too. Within the Textual content module’s Format choice crew, set each Justify Content material and Align Pieces to Middle.

text module flexbox settings

Fill the remainder two columns with content material to complete the preliminary design.

Step 3: Make Alignment Changes

Relying at the period of your content material, such because the bio textual content or the choice of talent tags, chances are you’ll understand small alignment shifts.

alignment shifts in Flexbox

To stay the structure balanced as content material adjustments, make a couple of focused Flexbox and Sizing changes with Justify Content material and Develop To Fill.

Even if it could be tempting to set Justify Content material > House Between most effective on the column degree, that doesn’t remedy each and every interior alignment factor. It separates the primary and ultimate direct kid parts, however center content material reminiscent of bios and tags would possibly nonetheless shift relying on its period.

A extra dependable way is to set each and every Column and primary Module Team to Justify Content material > House Between, then use Develop To Fill at the content material house that are supposed to take in the remainder house.

Subsequent, make a selection the primary Module Team. Open the Sizing choice crew and allow Develop To Fill.

This permits the primary content material crew to increase throughout the card, serving to the ground Social Icons crew keep aligned close to the top of the cardboard throughout other content material lengths.

To stay the Tag Team aligned above the Social Team, allow Develop To Fill at the Heading module as smartly.

This we could the heading and bio house take in more room, protecting the tag crew and social row in a extra constant place as content material adjustments.

three column layout with Flex settings and Grow To Fill

Step 4: Use Divi 5’s Responsive Gear

Flexbox is helping layouts adapt throughout breakpoints, however you must nonetheless overview pill and speak to perspectives. Use Divi’s Customizable Responsive Breakpoints to preview the structure on smaller monitors. Transfer between breakpoints to identify alignment or spacing problems, then follow focused changes with per-breakpoint Flexbox settings, Column Elegance values, or Construction Templates when wanted.

Step 5: Edit, Replica, Or Delete Columns

As soon as your crew member card works throughout breakpoints, including extra crew contributors is discreet. Open the row settings, then cross to the Parts choice crew. From right here, you’ll edit, replica, or delete any column.

modify columns in Divi 5

Duplicating a column copies the column styling, Flexbox settings, padding, borders, and nested modules. Replace the content material within the new column, then overview the structure at each and every breakpoint. As a result of Format Wrapping is enabled at the row, further playing cards can waft onto new traces as a substitute of requiring new rows.

Easiest Practices And Professional Pointers

Now that you simply’ve observed Flexbox alignment in motion, listed here are a couple of sensible pointers that will help you construct cleaner, extra maintainable layouts.

Regulate Alignment According to Breakpoint

You don’t have to make use of the similar alignment settings throughout each and every software. For instance, you could use Middle alignment on cellular for higher visible steadiness whilst protecting Get started alignment on desktop. Divi 5’s Responsive Editor and Customizable Responsive Breakpoints make those adjustments more uncomplicated to control.

Mix Alignment With Format Path

Switching between Row and Column course at other breakpoints adjustments how Justify Content material and Align Pieces behave. Use this deliberately when a horizontal desktop structure must transform a stacked or focused cellular structure.

Use Top When Operating With Align Content material

Align Content material most effective has a visual impact when wrapping creates more than one flex traces and the dad or mum container has additional cross-axis house. Including a top or minimal top, reminiscent of 600px, offers Align Content material room to distribute the ones wrapped traces.

All the time Take a look at With Actual Content material

Placeholder content material can conceal alignment problems. Take a look at with quick, medium, and lengthy reproduction, other button labels, various tag counts, and actual pictures early within the procedure so you’ll catch structure problems ahead of publishing.

Obtain The Layouts

That can assist you follow the whole lot lined on this submit, we’ve ready a zipped document referred to as Flexbox Alignment. It contains the instance layouts proven above, constructed with Flexbox alignment patterns you’ll check up on and reuse. You’ll be able to import any structure in my opinion or add the Flexbox Alignment – ALL.json document to import them suddenly.

flexbox alignment layout examples

To import them, cross in your WordPress dashboard and navigate to Divi > Divi Library. Click on the Import & Export button on the height.

import and export divi layouts

Transfer to the Import tab, make a selection a JSON document, and click on Import Divi Builder Layouts.

import divi layouts

As soon as imported, open a web page within the Visible Builder or create a brand new one. When the Builder rather a lot, click on so as to add a new phase to the web page.

add new section to Divi

Make a selection the Upload From Library tab, select a structure, and click on Use This Segment to load it onto the web page.

Grasp Alignment With Flexbox In Divi 5

For lots of commonplace alignment patterns, you now not want hidden Divider modules, spacing hacks, or customized CSS. Divi 5‘s Flexbox equipment come up with visible, content-aware controls for positioning, spacing, and aligning parts throughout responsive layouts.

In Phase 5 Of Mastering Flexbox: Reordering Content material For Higher Cellular Layouts, we’ll display methods to mix Show Order, Flexbox course adjustments, and Wrap Opposite to create higher cellular flows with out duplicating content material.

Obtain the instance layouts, experiment within the Visible Builder, and get started development cleaner, extra maintainable pages. Drop a remark under and tell us which alignment methodology you’re maximum excited to check out.

The submit Phase 4 Of Mastering Flexbox: Aligning Content material With out Spacers Or Customized CSS gave the impression first on Sublime Subject matters Weblog.

WordPress Web Design

[ continue ]