In Phase 8 of our Mastering Flexbox sequence, we thinking about controlling spacing with Hole as a substitute of depending on margin for repeated spacing patterns. We noticed how Horizontal Hole and Vertical Hole assist create cleaner, extra constant spacing throughout rows, columns, and Module Teams.

Now, in Phase 9, we’re specializing in some other commonplace responsive structure query: how do you create versatile multi-column sections with out achieving for CSS Grid each and every time? CSS Grid continues to be the precise software for true two-dimensional layouts, particularly when you want actual row and column placement, overlapping pieces, or extremely abnormal grid patterns. However for plenty of on a regular basis layouts, corresponding to card grids, cut up content material sections, sidebar layouts, characteristic rows, and mixed-width columns, Divi 5’s Flexbox machine provides you with a sooner, extra visible workflow.

Via combining Column Magnificence, Structure Wrapping, Hole, Justify Content material, Align Pieces, and Show Order, you’ll construct responsive, grid-like column layouts at once within the Visible Builder. On this put up, we’ll display you ways Column Magnificence works, the way it pairs with the Flexbox controls you’ve already discovered, and the way to create responsive column patterns that keep versatile throughout Desktop, Pill, and Telephone.

Let’s dive in.

Why You Ceaselessly Don’t Want CSS Grid In Divi 5

Many designers suppose that each and every multi-column structure wishes CSS Grid. In Divi 5, that isn’t all the time the case. Flexbox is particularly robust when you’re development layouts that drift in a single primary route, wrap onto new traces, and adapt naturally as area adjustments.

That covers many commonplace web page patterns, together with:

  • Equivalent-width characteristic grids
  • Uneven content material sections
  • Card layouts with wrapped rows
  • Content material and sidebar combos
  • CTA sections with combined column widths
  • Responsive footer buildings

There are a number of benefits to the usage of Flexbox for those layouts:

  • Cleaner alignment and spacing keep watch over: Justify Content material, Align Pieces, and Hole assist you to set up alignment and gutters at once from the mother or father container.
  • More uncomplicated responsive reflow: Column Magnificence and Structure Wrapping let columns transfer onto new traces with out duplicating sections or writing media queries.
  • Versatile cell hierarchy: Show Order means that you can transfer vital columns previous or later at particular breakpoints.
  • More effective nesting: Module Teams, Nested Rows, and nested components can every have their very own structure context when a part of a Flex construction.

That stated, CSS Grid nonetheless has its position. Use Grid when your design wishes actual two-dimensional keep watch over over rows and columns, offset placement, overlapping components, or a structure that are supposed to apply a set grid map as a substitute of a herbal flex drift.

For plenty of Divi layouts, even though, Flexbox is sufficient. It helps to keep the construction visible, responsive, and more straightforward to regulate within the builder.

Figuring out Column Magnificence

Column Magnificence is without doubt one of the maximum vital sizing equipment in Divi 5’s Flexbox machine. It means that you can make a choice how a lot horizontal area a Column will have to take inside of a Flex row. As an alternative of atmosphere mounted pixel widths, you select a predefined fraction. Divi then makes use of that price because the Column’s width foundation within the Flex structure, whilst nonetheless running along Hole, Structure Wrapping, and different Flexbox controls.

What Column Magnificence In reality Does

While you set a Column Magnificence on a Column, you might be defining how broad that Column will have to be throughout the Row’s Flex structure. For instance:

  • Fullwidth makes use of the total to be had row width.
  • 1/2 creates a half-width column.
  • 1/3 creates a third-width column.
  • 1/6 creates a narrower column that may have compatibility into denser multi-column layouts.

Divi 5 Column Class

This makes it more straightforward to create equivalent and uneven layouts with out writing customized CSS.

You’ll be able to make a choice from a number of predefined widths, together with Fullwidth, 3/4, 2/3, 1/2, 1/4, and extra. You’ll be able to additionally make a choice No Column Magnificence when you wish to have the Column’s dimension to be decided by way of its content material and different sizing habits as a substitute of a predefined fraction.

How Column Magnificence Works With Structure Wrapping

Column Magnificence turns into particularly helpful when mixed with Structure Wrapping. When Wrap is enabled, Columns can take a seat facet by way of facet so long as there’s sufficient to be had area.

three columns side by side

When the mixed Column widths and Hole values now not have compatibility on one line, the Columns can wrap onto the following line. Each and every Column nonetheless respects its Column Magnificence price after it wraps.

That is the core trend in the back of many responsive, grid-like layouts constructed with Flexbox.

Responsive Column Magnificence

Column Magnificence will also be adjusted in step with breakpoint. That suggests a structure can use wider multi-column settings on Desktop, more practical two-column settings on Pill, and a single-column stack on Telephone.

Divi 5 Structure Templates

For instance, six Columns set to 1/3 on Desktop might paintings neatly in a large structure, however that very same construction might really feel cramped on Pill or Telephone. If so, you’ll regulate person Column Magnificence values at a decrease breakpoint or follow a Construction Template from the Row’s Content material tab to replace more than one Columns sooner.

This provides you with responsive construction keep watch over with out writing media queries or duplicating the similar content material for various gadgets.

Combining Column Magnificence With Different Flexbox Controls

Column Magnificence controls the width of the Columns, however the surrounding Flexbox settings keep watch over how the ones Columns align, wrap, area, and reorder. The most powerful layouts typically mix a number of of those controls.

Structure Path + Structure Wrapping

For column layouts, you’ll typically stay Structure Path set to Row so Columns drift horizontally.

Divi 5 Layout Direction

While you allow Structure Wrapping, Columns can transfer to the following line after they now not have compatibility facet by way of facet. That is what lets in one Row to act like a responsive multi-row structure.

Layout Wrapping in Divi 5

Justify Content material And Align Pieces

Justify Content material controls how Columns are allotted alongside the principle axis. Helpful choices come with Get started, Heart, Area Between, and Area Flippantly.

justify content in Divi 5

Align Pieces controls alignment alongside the move axis. In a horizontal row, that typically method vertical alignment. Stretch comes in handy when you wish to have Columns in the similar line to percentage the to be had top.

Align Items in Divi 5

In combination, those controls can help you refine how Columns take a seat throughout the Row after their widths are outlined by way of Column Magnificence.

Horizontal Hole And Vertical Hole

As we coated in Phase 8, Hole is typically the cleanest approach to keep watch over repeated spacing between comparable components. Practice Horizontal Hole at the Row to create gutters between Columns.

Horizontal Gap in Divi 5

Practice Vertical Hole at the Row to keep watch over spacing between wrapped traces of Columns. You’ll be able to additionally follow Vertical Hole to person Columns or Module Teams to keep watch over spacing between modules inside of them.

Vertical Gap in Divi 5

The use of Hole as a substitute of repeated margins helps to keep spacing more straightforward to regulate when Columns wrap on smaller displays.

Show Order

Show Order means that you can alternate the visible order of Columns with out shifting them within the web page construction. That is particularly helpful at Pill and Telephone breakpoints. For instance, you’ll stay a textual content Column first on Desktop however transfer a picture Column above it on Telephone by way of giving the picture Column a decrease Show Order price, corresponding to -1.

Use Show Order selectively. Since visible order can fluctuate from supply order, take a look at keyboard center of attention and studying drift when reordering vital interactive content material.

Sensible Examples

Now that you know how Column Magnificence works and the way it combines with different Flexbox controls, let’s have a look at 5 layouts. Each and every instance demonstrates a distinct responsive column trend you’ll construct with Flexbox, with out switching to CSS Grid.

Instance 1: Equivalent Multi-Column Grid

Flexbox Columns example 1

Structure: This Segment makes use of two Rows: one wider intro Row with a Column set to Column Magnificence > 2/3, and some other Row with twelve equivalent pieces set to Column Magnificence > 1/6. The article Row creates a responsive grid-like structure that may shift from six Columns on Desktop to fewer Columns in step with line on smaller displays.

Demonstrates: Equivalent Column Magnificence values, Structure Wrapping, and Hole for constant gutters.

Instance 2: Content material + Stats + Quote Bar

Flexbox Columns example 2

Structure: This structure pairs a visible card at the left with frame textual content and 3 key stats at the appropriate, the usage of a Nested Row for the stats. A full-width quote bar sits beneath.

Demonstrates: Blended Column Categories, Nested Rows, not obligatory Show Order, and multi-level Hole keep watch over.

Instance 3: Uneven Card Structure

Flexbox Columns example 3

Structure: This Segment makes use of 5 Columns. The primary and remaining Columns are set to Fullwidth, whilst the second one, 0.33, and fourth Columns use Column Magnificence > 1/3.

Demonstrates: Fullwidth and fractional Column Magnificence combos, Structure Wrapping, Horizontal Hole, and Vertical Hole.

Instance 4: Vintage 3×2 Characteristic Grid

Flexbox Columns example 4

Structure: Six equivalent characteristic playing cards take a seat inside of one Flex Row and wrap into more than one traces.

Demonstrates: Easy responsive Columns the usage of Column Magnificence, Hole, and Align Pieces.

Instance 5: Break up Content material + Information Card

Flexbox Columns example 5

Structure: Huge textual content and buttons take a seat within the peak space, whilst a depressing knowledge panel or table-style card sits underneath.

Demonstrates: Uneven Column Magnificence combos, Fullwidth rows inside of a wrapping Flex construction, and Justify Content material > Area Between for distribution.

Step-Via-Step Construct: Growing A Versatile One-Row Structure

This situation displays the way to construct a multi-column structure the usage of one Flex Row, a number of Columns, Column Magnificence values, Hole, and focused alignment settings. On Desktop, the Columns create a balanced multi-line composition. On Pill and Telephone, the similar construction reflows with responsive Column Magnificence adjustments and a Construction Template.

Flexbox example step by step

Configure The Row Construction

Get started by way of opening a web page within the Visible Builder or including a brand new Segment to an current web page. Upload a single-column Row to the Segment.

adding a single-column Flex row in Divi 5

Within the Row settings, move to the Design tab. Extend the Structure choice team and follow a 25px Horizontal Hole and 25px Vertical Hole. Then allow Structure Wrapping > Wrap.

row flex settings

Configure The First Column

Open the Column settings, move to the Design tab, and amplify the Sizing choice team. Set Column Magnificence to 2/3.

Subsequent, amplify the Structure choice team within the Design tab. Set the Vertical Hole to 15px. Stay the remainder Flex settings at their defaults except your design wishes further changes.

first column vertical gap

Within the first Column, upload two Textual content modules. Upload your content material and elegance it as wanted.

first column content

Upload A 2nd Column

Now upload some other Column to the Row. Within the Row’s Content material tab, click on + Upload Component within the Components choice team.

add a new column element

Open the brand new Column’s Design tab, amplify the Structure choice team, and upload a 15px Vertical Hole.

second column vertical gap

Subsequent, amplify the Sizing choice team and assign Column Magnificence > 1/2.

1/2 Column Class

Upload an Symbol, a Heading, and a Textual content module to the Column, then genre them as wanted.

second column content

Within the Column’s Design tab, upload a border, border radius, and spacing.

column border styles

Upload A 3rd Column

Upload some other Column to the Row and assign Column Magnificence > 1/3.

third column class

Then right-click the 2nd Column’s Border types and duplicate them to the 0.33 Column. Upload 25px Padding within the Spacing choice team to provide the Column respiring room.

Whilst within the Design tab, amplify the Structure choice team. Set Justify Content material to Area Between.

Justify Content Space Between

Subsequent, upload the content material to the Column. Upload a Heading, a Textual content module, and a Module Crew, then genre them as wanted.

third column content

Within the Module Crew, upload a Divider module and a Textual content module. Then open the Module Crew’s Design tab, amplify the Structure choice team, and set a 5px Vertical Hole.

Module Group Vertical Gap

Configure The Fourth Column

In any case, upload some other Column to the Row and assign Column Magnificence > 1/6.

Proper-click the 0.33 Column and choose Reproduction Attributes.

copy column attributes

Then right-click the fourth Column, make a choice Paste, and use Make a choice Design Attributes to stick the border attributes. Repeat the method for the spacing and structure attributes.

Subsequent, upload a Module Crew to the Column. Position a Heading module and a Textual content module inside of it. Open the Module Crew’s Design tab, amplify the Structure choice team, and set the Vertical Hole to 0px.

zero Vertical Gap

Reproduction the Module Crew two times and replace the Heading and Textual content content material for every Crew.

Make Responsive Changes

Transfer to the Pill breakpoint. Stay the Hole and Flex settings the similar as Desktop for now, however alternate a couple of Column Magnificence values so the content material flows extra naturally.

Beginning with the first Column, alternate the Column Magnificence from 2/3 to Fullwidth.

Depart the second one Column as is, however alternate the 0.33 Column’s Column Magnificence to 1/2.

Alternate the fourth Column’s Column Magnificence to Fullwidth and alter its Structure Path to Row. This puts the Module Teams facet by way of facet within the fourth Column as a substitute of stacking them vertically.

Now transfer to the Telephone breakpoint. As an alternative of enhancing each and every Column Magnificence manually, follow a Construction Template to resize the Columns for smaller displays. Within the Row’s Content material tab, amplify the Components choice team and click on Practice Construction Template.

apply a Structure Template in Divi 5

Make a choice the Unmarried Row template to use it on all Columns within the Row.

Single Row template

Now, as you cycle thru breakpoints, the similar Flex segment adapts to Desktop, Pill, and Telephone with out rebuilding the structure from scratch.

Pointers And Highest Practices

Listed below are a couple of sensible tips that will help you get probably the most out of Column Magnificence and Flexbox in Divi 5:

  • Make a choice Column Magnificence combos sparsely: Get started with the most simple fractions that succeed in your design, corresponding to 1/2, 1/3, 1/4, and 2/3. Advanced combos could make responsive changes more difficult to trace later.
  • Use Structure Wrapping when one Row will have to change into multi-line: If the structure accommodates comparable pieces, corresponding to playing cards or stats, one wrapping Row will also be more straightforward to control. If the content material varieties are very other, more than one Rows might nonetheless be cleaner.
  • Arrange spacing with Hole on the appropriate point: Use Row-level Horizontal Hole and Vertical Hole for spacing between Columns and wrapped traces. Use Column-level or Module Crew-level Hole for spacing between modules inside of every Column.
  • Check with actual content material: Placeholder textual content can disguise wrapping and alignment problems. Use lifelike headings, paragraphs, button labels, and symbol dimensions ahead of finalizing the responsive construction.
  • Use Develop To Fill best when it solves a transparent alignment downside: Develop To Fill can assist equalize inside spacing in card-style layouts, particularly when mixed with Justify Content material > Area Between, nevertheless it will have to no longer substitute a blank construction.
  • Steer clear of overcomplication: Column Magnificence, Hole, and Structure Wrapping are sufficient for plenty of responsive column layouts. Upload Justify Content material, Align Pieces, Show Order, or Develop/Shrink best after they remedy a particular factor.

Obtain The Information

That will help you discover responsive Columns in Divi 5, we’ve created a zipper document with the layouts used on this put up. To make use of them, move to Divi > Divi Library within the WordPress dashboard and click on the Import & Export button.

Divi Library import

The zip document comprises seven information: one Flexbox Columns – ALL.json document, person JSON information for examples 1-5, and one JSON document for the step by step instance.

Flexbox Columns JSON files

To import the information, choose the Import tab, make a choice a document, and click on Import Divi Builder Layouts.

import Divi Builder layouts

Subsequent, open a brand new or current web page within the Visible Builder. Click on the blue + icon so as to add a brand new Segment.

add new Section to Divi

Click on the Upload From Library tab and choose a structure to load it onto the Canvas.

add layout to Visual Builder

Construct Responsive Columns In Divi 5

With Column Magnificence and the Flexbox controls in Divi 5, you’ll create versatile multi-column layouts that adapt throughout breakpoints with out achieving for CSS Grid in lots of commonplace eventualities. You’ve now noticed the way to outline Column widths, mix them with Structure Wrapping, Hole, Justify Content material, Align Pieces, and Show Order, and regulate the similar structure construction throughout Desktop, Pill, and Telephone.

Within the ultimate installment of the sequence, Phase 10 Of Mastering Flexbox: Highest Practices And Useful Pointers, we’ll convey the whole thing at the side of sensible suggestions, commonplace pitfalls to steer clear of, and workflow pointers for development cleaner Flexbox layouts in Divi 5.

Obtain the instance layouts from this put up, experiment with other Column Magnificence combos, and get started making use of those patterns on your personal initiatives. As soon as you know how Column Magnificence, Hole, and Structure Wrapping paintings in combination, responsive Columns change into a lot more straightforward to construct and handle.

The put up Phase 9 Of Mastering Flexbox: Growing Responsive Columns With out CSS Grid seemed first on Chic Issues Weblog.

WordPress Web Design

[ continue ]