In Phase 2 of our Mastering Flexbox sequence, we confirmed you easy methods to create equal-height playing cards with aligned buttons the use of Align Pieces > Stretch, Justify Content material > Area Between, and Develop To Fill. On this 3rd installment, we’ll center of attention on probably the most necessary construction selections in Divi 5: 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. Opting for between No Wrap, Wrap, and Wrap Opposite impacts what number of rows you wish to have, how your structure responds throughout breakpoints, and what kind of guide construction you need to organize.

On this put up, we’ll evaluate No Wrap and Wrap construction templates, give an explanation for when every choice is smart, and display how supporting controls like Column Elegance, Align Content material, and Show Order permit you to construct cleaner responsive layouts with out customized CSS.

Let’s dive in.

Working out Structure Wrapping In Divi 5

In Divi 5, Structure Wrapping controls whether or not direct kid parts inside of a Flex container keep on a unmarried line or wrap onto further strains after they run out of area.

That is necessary as a result of wrapping most effective impacts the direct kids of the container you’re enhancing. As an example, in case you’re enhancing a Row, wrapping impacts its Columns. Should you’re enhancing a Module Team, wrapping impacts the modules or teams inside of it.

The 3 Structure Wrapping Choices

Divi 5 will provide you with 3 Structure Wrapping possible choices:

No Wrap

No Wrap helps to keep all direct kid pieces on a unmarried flex line. If there isn’t enough space, pieces would possibly shrink, overflow, or create horizontal scrolling relying on their sizing and different structure settings.

no wrap in Divi 5

Wrap

Wrap lets in pieces to transport onto further strains after they not are compatible within the mum or dad container. That is the basis for lots of responsive card grids, galleries, characteristic sections, footer layouts, and multi-column content material blocks in Divi 5.

wrap in Divi 5

Wrap Opposite

Wrap Opposite additionally lets in pieces to wrap, but it surely reverses the route wherein new flex strains are positioned alongside the pass axis. It does now not opposite the order of each and every person merchandise. As an alternative, it adjustments the place wrapped strains seem.

This will also be helpful when you wish to have wrapped strains to stack in the wrong way at a particular breakpoint. For exact item-by-item reordering, use Show Order.

wrap reverse in Divi 5

When To Use Each and every Possibility

Use No Wrap while you deliberately need parts to stick on one line. This works neatly for compact navigation patterns, button teams, emblem rows, or any structure the place automated line breaks would disrupt the design.

Use Wrap when you wish to have a structure to evolve throughout to be had area. That is probably the most helpful choice for characteristic playing cards, pricing tables, staff grids, galleries, weblog put up layouts, footer teams, and different multi-line constructions.

Use Wrap Opposite when you wish to have wrapped strains to stack in the wrong way. It may well assist with particular responsive patterns, however for detailed cell ordering, mix it with the Show Order box on the Column or module point.

How Wrapping Interacts With Structure Path

Structure Wrapping adjustments in accordance with the container’s Structure Path.

With Row route, pieces go with the flow horizontally. When Wrap is enabled, overflowing pieces transfer onto a brand new line under. With Wrap Opposite, the brand new wrapped line is positioned within the reverse cross-axis route.

With Column route, pieces go with the flow vertically. When Wrap is enabled, overflowing pieces can transfer into a brand new column alongside the pass axis.

For Column wrapping to be visual, the mum or dad container normally wishes an outlined top. If the container top is about to Auto, there is also no constrained vertical area that forces pieces to wrap into every other column.

column height in Divi 5

Align Content material turns into helpful when wrapping creates a couple of flex strains and the mum or dad container has additional cross-axis area to distribute.

align content in Divi 5

As a result of Divi 5’s Flexbox controls are responsive, you’ll regulate Structure Wrapping, Structure Path, gaps, and alignment settings one by one at other breakpoints.

No Wrap Construction Templates

When Structure Wrapping stays set to No Wrap, all direct kids keep on a unmarried flex line. That is acquainted conduct for lots of Divi customers and works neatly for easy row constructions. Alternatively, when you wish to have a couple of strains, No Wrap normally manner developing and managing a couple of rows.

Instance: Characteristic Playing cards With No Wrap

To create a two-row grid of six characteristic playing cards with No Wrap, you wish to have two separate rows, every with 3 columns.

no wrap example 2

Within the instance under, the footer structure calls for a couple of rows to create separate desktop strains: one row for 5 columns, one row for a full-width house, and every other row for 2 columns.

no wrap example 4

The limitation of No Wrap is structural. It may be predictable, however the rest past a unmarried line incessantly calls for additional rows, extra duplicated construction, and extra breakpoint control.

Wrap Construction Templates

Whilst you allow Structure Wrapping > Wrap, the similar layouts grow to be extra versatile. As an alternative of manually developing separate rows, you’ll incessantly use one mum or dad row and make allowance its kid columns to wrap naturally.

As an example, the similar six-card structure will also be constructed with one row and 6 columns.

wrap example 2

With Wrap enabled, the playing cards go with the flow into a couple of strains. To create the three-column desktop construction, set every column’s Column Elegance to 1/3 within the Design tab below the Sizing choice workforce.

column class in Divi 5

Within the Wrap model of the footer structure, a unmarried row can include a couple of columns with other Column Elegance settings. The primary 5 columns are set to 1/5 width, putting the principle hyperlink teams facet through facet on desktop. The 6th column is about to Fullwidth, and the remainder columns are set to 1/2 width.

wrap example 4

This we could one versatile row care for a extra complicated desktop construction whilst nonetheless adapting extra cleanly at smaller breakpoints.

Mastering Align Content material For Multi-Line Layouts

When you allow Wrap or Wrap Opposite and your content material flows onto a couple of strains, Align Content material controls how the ones wrapped strains are disbursed alongside the pass axis. That is other from Align Pieces, which aligns person pieces inside of every line.

Vital observe: Align Content material most effective has a visual impact when there are a couple of flex strains and the mum or dad container has additional cross-axis area. If the row top is about to Auto and the container most effective grows to suit its content material, Align Content material would possibly seem to do not anything.

height auto in Divi 5 sizing tab

Align Content material vs Align Pieces

Align Pieces aligns person flex pieces inside of every flex line alongside the pass axis. It impacts the pieces themselves, now not the gang of wrapped strains.

Align Content material aligns the wrapped strains as a gaggle throughout the mum or dad container’s to be had cross-axis area.

The most straightforward manner to keep in mind it:

  • Align Pieces: Aligns pieces inside of every flex line.
  • Align Content material: Aligns the flex strains themselves when wrapping creates a couple of strains.

Wrap Opposite And Show Order

Whilst Wrap is the choice you’ll use maximum incessantly, Wrap Opposite will provide you with in a different way to modify how wrapped strains stack. It may be useful for particular responsive patterns, but it surely must now not be handled as a substitute for Show Order when you wish to have exact item-level keep an eye on.

Instance: Featured Pricing Card

When developing multi-column pricing tables, a Featured card can finally end up on the second one wrapped line on smaller monitors, inflicting it to seem not up to the encompassing plans.

featured card on bottom of row

By means of enabling Wrap Opposite at Pill and Telephone breakpoints, you’ll exchange the place the wrapped line seems and convey that Featured card upper within the visible go with the flow.

In additional complicated layouts with a couple of columns, Show Order turns into the easier software. This case makes use of a three-row alternating image-and-text structure. On desktop, the construction works neatly. On cell, the herbal supply order can stack photographs in combination, developing an ungainly go with the flow.

How Show Order Works

You don’t want to set a price on each and every column. Alter most effective the columns that want to transfer out in their herbal supply order. Columns left clean stay their default order worth and care for their relative place amongst different unchanged pieces.

adjust display order

On this structure, most effective 3 columns want to exchange at the Telephone breakpoint. Choose the 3rd column, pass to the Content material tab, increase the Order choice workforce, and set Show Order to 2.

display order 2

Subsequent, set the 5th column to 3 and the 6th column to 4.

The result’s a cleaner alternating trend of pictures and textual content on cell, with only some centered order adjustments.

Professional Tip: Use Wrap Opposite for line-level stacking adjustments and Show Order for item-level reordering. Combining each at particular breakpoints allows you to stay the desktop construction blank whilst bettering the cell go with the flow.

Responsive Very best Practices & Professional Pointers

Divi 5 will provide you with responsive keep an eye on over wrapping conduct. Listed here are a couple of practices that permit you to get well effects.

Use Divi 5’s Responsive Gear

At all times preview layouts at Desktop, Pill, and Telephone breakpoints. Use the Responsive Editor and Customizable Responsive Breakpoints to regulate Structure Wrapping in line with instrument when wanted.

As an example, you’ll stay No Wrap on Desktop for a horizontal emblem bar, then transfer to Wrap on Pill and Telephone so the emblems can transfer onto further strains.

Mix Settings For Potency

Pair Wrap with Column Elegance settings to create responsive layouts the use of fewer rows. Mix Wrap and Align Content material when you wish to have higher distribution throughout a couple of strains, and use Show Order most effective at the columns that want to exchange place at smaller breakpoints.

Commonplace Problems To Steer clear of

Forgetting to set an outlined top or minimal top at the mum or dad container is a commonplace reason why Align Content material seems to do not anything. If the row top is about to Auto, there is also no additional cross-axis area for Align Content material to distribute. Upload a minimal top, akin to 500px or 60vh, when the structure wishes visual multi-line distribution.

Steer clear of overusing No Wrap for content-heavy sections. It may well pressure you to regulate additional rows {that a} unmarried wrapping Flex row may care for extra successfully.

Assessment Wrap Opposite and Show Order at smaller breakpoints when the herbal stacking order creates surprising visible effects.

Check With Actual Content material

Check your layouts with actual content material of various lengths. Placeholder content material can conceal alignment and wrapping problems that seem with exact reproduction, picture dimensions, button labels, or hyperlink teams. Pay particular consideration to how wrapped strains behave on Pill and Telephone, then regulate gaps, Column Elegance values, Structure Wrapping, and alignment settings as wanted.

Obtain And Set up The Information

That can assist you perceive Wrap vs No Wrap, we’ve created segment layouts that exhibit No Wrap, Wrap, and Wrap Opposite. Each and every structure is classified so you’ll investigate cross-check the construction and settings within the Visible Builder.

Wrap vs No Wrap JSON files

To get entry to them, fill out the shape under and obtain the zipped Wrap vs No Wrap record for your laptop. Then pass to Divi > Divi Library and make a selection the Import & Export button.

Divi Library import

Select the Import tab, make a selection the segment you’d love to import, or select the Wrap VS No Wrap – ALL.json record to import all layouts. When you’ve made an expansion, click on Import Divi Builder Layouts.

Import Divi Builder Layouts

Subsequent, create a brand new web page or open an present one within the Visible Builder. Click on so as to add a brand new segment to the web page.

add a new Divi section

Choose the Upload From Library tab and select the structure you’d love to import.

import a layout into the Visual Builder

In spite of everything, click on Use This Phase to load the segment onto the web page.

use this section

Wrap vs No Wrap: Development Higher Layouts In Divi 5

With a transparent working out of No Wrap, Wrap, and Wrap Opposite, you’ll construct cleaner and extra environment friendly layouts in Divi 5. No Wrap helps to keep constructions predictable on a unmarried line. Wrap we could one mum or dad container care for multi-line constructions with fewer rows. Wrap Opposite will provide you with an alternative choice for controlling how wrapped strains stack at particular breakpoints.

The actual energy comes from combining Structure Wrapping with Column Elegance, Align Content material, responsive controls, and Show Order. In combination, those settings permit you to construct layouts that adapt throughout display screen sizes whilst retaining the construction more uncomplicated to regulate.

In Phase 4 of Mastering Flexbox in Divi 5, we’ll display you complicated alignment ways that cut back the desire for guide spacing and customized code.

Obtain the instance templates, experiment with the other wrapping choices for your initiatives, and tell us within the feedback which method you’re maximum excited to check out.

The put up Phase 3 Of Mastering Flexbox: Wrap vs No-Wrap Construction Templates gave the impression first on Sublime Topics Weblog.

WordPress Web Design

[ continue ]