Previous than Divi 5, development layouts that broke out of Divi’s usual column buildings endlessly supposed nesting rows, writing custom designed CSS, or settling for a simpler design. Divi 5 changes that thru bringing CSS Grid into the Visual Builder.
CSS Grid will give you precise control over two-dimensional layouts. Instead of most straightforward arranging items in a row or column, you’ll define rows and columns at the an identical time. Then, you’ll function teenager elements all the way through that development.
In Divi 5, layout-capable containers paying homage to Sections, Rows, Columns, Groups, and supported nested Module containers can use Grid. Once a container is able to Grid, you’ll control key grid settings paying homage to track counts, gaps, alignment, products placement, and rule-based offsets from the settings panel.
This is Section 11 of the Divi 5 Mastery Trail. In this section, we’ll take one Row containing six Columns with content material subject material and styling already applied. Then, we’ll reshape it 3 different ways the use of row-level grid controls.
First, we’ll use a one-click Development Template. Next, we’ll use a singular Development Template with Grid Offset Regulations. In spite of everything, we’ll use a Masonry template that combines a denser column development with multi-property offset rules. After that, we’ll add responsive overrides at tablet and make contact with breakpoints.
The content material subject material and column-level sorts stay the an identical. Easiest the Row-level Layout selection workforce and Grid Offset Regulations do the artwork.
In the course of the tip, you’ll know how to navigate Divi 5’s Grid settings, use Development Templates, understand Grid Offset Regulations, and adapt sophisticated grids all the way through breakpoints. Along side the Flexbox concepts from Section 10, CSS Grid will give you a stronger layout toolkit for development custom designed Divi 5 web websites.
How CSS Grid Works
CSS Grid is a layout means built into trendy browsers. While Flexbox arranges items mainly along one axis, each a row or a column, Grid arranges items in two dimensions at once.
You define the development throughout the father or mom container. Then, its children fill that development as grid items.
Mom or father And Child Controls
Two layers of control subject.
- The daddy or mom, or grid container, defines the development. This incorporates what choice of columns and rows there are, how huge and tall every track is, the gap between tracks, and the default alignment of items throughout the grid.
- Each and every teenager, or grid products, can override its private placement. A single products can span a few cells, get began at a selected column or row, or align otherwise from its siblings.
Divi 5 follows this an identical parent-and-child model. The Layout selection workforce on the father or mom controls the grid development. The Sizing selection workforce on every teenager controls how that child sits throughout the grid.
Once that mental model is plain, the settings change into more straightforward to be expecting. Mom or father settings define the grid. Child settings define how individual items behave inside of it.

How To Set A Container To Grid
You’re going to maximum incessantly use Grid on containers paying homage to Sections, Rows, Columns, and Groups. With Divi 5’s Nested Modules system, supported native modules can also act as layout folks and come with other modules or rows.
Grid layout settings are applied at the father or mom container level. They define the whole rules for the best way the grid works and the best way teenager items respond to it.
Get began With A Simple Grid
Let’s get began thru development something simple. Add a Section with a single-column Flex Row. Then, open the Row settings and change the Row from Flex to Grid.
Next, industry the Row’s grid development to a 6-column grid.
When running with Grid, it’s serving to to separate two ideas. A grid column is part of the CSS Grid development. A Divi Column is a Divi container part.
Together with grid columns throughout the Layout settings isn’t the an identical as together with Divi Columns to a Row. On the other hand, the two can artwork together.
Now, add six Divi Columns throughout the Row. You presently have six Divi Columns situated into six grid columns.
Next, industry the grid development from six columns to a couple of columns. Notice how the an identical six Divi Columns glide into the new development.
Must you take a look at the breakpoints, the 3-column grid remains in function with the exception of you override it at a selected breakpoint.
This straightforward example shows the core Grid workflow. Define the grid development at the father or mom level. Then, let the child elements glide into it.
Previous than transferring further, let’s check out the principle Grid settings Divi provides.
Row-Level Grid Settings: The Layout Risk Body of workers
When a Row is able to Grid, the Layout selection workforce controls the grid development. Right here’s a quick reference for the principle settings.
- Horizontal Hollow and Vertical Hollow: Control spacing between grid columns and rows.
- Column Widths: Control how grid columns are sized, along side an identical widths or custom designed track sizing.
- Collection of Columns: Defines what choice of columns the grid uses.
- Collapse Empty Columns: Helps with dynamic layouts where some grid cells is also empty.
- Grid Auto Columns: Gadgets the scale of robotically generated columns when items are situated outside the defined grid.
- Row Heights: Controls how grid rows are sized, along side auto-height rows or equal-height rows.
- Collection of Rows and Grid Auto Rows: Provide row-based controls similar to the column controls above.
- Grid Trail: Controls how items auto-place all through the grid, paying homage to row trail or column trail.
- Grid Density: Controls whether or not or now not the grid follows commonplace provide order or backfills empty cells with later items when conceivable.
- Justify Content material subject material and Align Content material subject material: Position the entire grid throughout the container when extra space is available.
- Align Items and Justify Items: Set the default alignment for items inside of their grid cells.
- Offset Regulations: Practice position-based layout rules to teenager items from the daddy or mom level. The ones are useful for asymmetric or repeating grid patterns.
Child-Level Grid Settings: The Sizing Risk Body of workers
Mom or father-level Grid settings define the grid. Child elements can nevertheless control how they occupy space inside of that grid.
Click on on into one of the crucial six Columns. Open the Design tab and prolong the Sizing selection workforce.
Beneath the standard Width, Most sensible, and Module Alignment controls, grid products settings appear.
- Column Span and Row Span: Control what choice of grid tracks the article occupies. For example, setting Column Span to 2 makes the article span two grid columns.
- Column Get began, Column End, Row Get began, and Row End: Pin the article to express grid traces. Use the ones when a span worth isn’t precise enough, paying homage to when an products needs to start out out at column 2 and end at column 5.
- Align Self and Justify Self: Override the daddy or mom’s default alignment for that products most straightforward.
The ones controls appear on direct children of a father or mom container set to Grid, along side Columns, Groups, and modules. They’re useful for asymmetrical layouts where one card occupies a larger hero block while the rest enjoying playing cards take a seat down in a tighter affiliation.
In this tutorial, we’ll maximum often use Grid Offset Regulations at the father or mom level as an alternative of enhancing every teenager manually. That approach lets us create repeating layout patterns that continue to artwork despite the fact that further teenager items are added later.
On the other hand, while you’ve were given a difficult and rapid choice of teenager elements, setting custom designed spans on the individual children can also artwork smartly.
Exploring What’s Possible With CSS Grid In Divi 5
CSS Grid is a logical way to control how teenager elements behave inside of a container. As you spotted above, the daddy or mom can define the entire grid while individual children can nevertheless smash from the default pattern.
To pay attention to Grid, we’ll keep the use of the six-Divi-Column development from the previous section. The content material subject material and elementary sorts are already in function. Due to this fact, the examples underneath focal point most straightforward on changing the grid layout.
3 Layout Permutations
We’ll reshape the an identical content material subject material three ways:
- Variation 1: A simple grid created with one Development Template.
- Variation 2: An alternating grid created with a Development Template and Grid Offset Regulations.
- Variation 3: A masonry-style grid created with multi-property offset rules and responsive overrides.
Variation 1: Practice A Development Template
Now now we have already seen recommendations on how one can industry a Row to Grid and change the choice of grid columns. The fastest way to get a running grid layout is to let Divi configure those settings with a Development Template.
Switch to the Row’s Content material subject material tab. At the bottom of the Parts report, click on on Practice Development Template.

Make a choice a Multi-Row Template
You’re going to peer grouped templates, along side preconfigured grid layouts. Look underneath Multi-Row, Masonry, and Sidebar. Each and every thumbnail represents a whole layout configuration, along side the choice of columns, hollow values, and products placement rules.
Pick the third Multi-Row template. The Row updates to a 3-column grid with defaulted 60px Horizontal Hollow and 60px Vertical Hollow values.
Open the Row’s Design tab and take a look at the Layout selection workforce. You will have to see Layout Style set to Grid, Collection of Columns set to 3, and the gap values applied.
This straightforward grid development works smartly for service choices, product loops, blog layouts, and other flippantly spaced card layouts.
Variation 2: Use Grid Offset Regulations
For the second variation, we’ll use a singular Development Template that creates an alternating pattern with Grid Offset Regulations. The ones rules control which teenager items span additional columns.
Inside the Row’s Content material subject material tab, click on on Practice Development Template another time. Then, pick the eleventh Multi-Row template. The Row nevertheless makes use of three grid columns, on the other hand it supplies offset rules that ensure that teenager items span a few column tracks.
Inspect The Offset Regulations
Divi’s Development Templates can include more than basic column counts. Some templates moreover include offset rules, this means that that you simply’ll observe a Grid layout and its repeating placement not unusual sense in a few clicks.
Now, let’s check out the rules. Open the Row’s Design tab, prolong the Layout selection workforce, and to seek out Grid Offset Regulations. You will have to see two rules created in the course of the Development Template.

Rule 1: Span Every 4n+2 Products
The principle rule uses the ones settings:
- Admin Label: Auto-generated from the rule of thumb of thumb settings, paying homage to 4n+2 Spans 2 Columns.
- Objective Offset: Custom designed nth-child Rule, with the craze set to 4n+2. This fits the second one products, then every 4th products after that: 2, 6, 10, and so on.
- Offset Rule: Column Span. This tells Divi which grid property to modify on the focused items.
- Offset Value: 2. This makes every focused products span two column tracks as an alternative of one.
Be told from top to bottom, the rule of thumb of thumb says: function items 2, 6, 10, and onward, and make every one span two column tracks.
That creates a repeating pattern where every fourth focused products becomes wider at the right kind side of the grid.
Rule 2: Span Every 4n+3 Products
The second rule does the an identical issue, on the other hand targets a singular set of child items.
- Admin Label: Auto-generated from the rule of thumb of thumb settings, paying homage to 4n+3 Spans 2 Columns.
- Objective Offset: Custom designed nth-child Rule, with the craze set to 4n+3. This fits the 3rd products, then every 4th products after that: 3, 7, 11, and so on.
- Offset Rule: Column Span. This changes the an identical grid property as the principle rule, on the other hand for a singular products pattern.
- Offset Value: 2. This makes every focused products span two column tracks.
Together, the two rules create an alternating rhythm. The second one products in every workforce of four spans two columns. Within the interim, the 3rd products in every workforce of four moreover spans two columns. The primary and 4th items keep one column huge.
Invert The Pattern
Must you wanted to invert the craze and get began with a larger products, you could need to industry the rules to these patterns:
- First Rule: 4n+1 spans two columns.
- second Rule: 4n+4 spans two columns.

Grid Offset Regulations open up many layout possibilities because of they allow you to create repeating asymmetric patterns from the daddy or mom container. Next, we’ll use a further sophisticated grid development.
Variation 3: Create A Masonry-Style Grid
The third variation uses a Masonry Development Template and two Grid Offset Regulations. This time, the rules function two different grid properties within the an identical layout: Row Span and Column Span.
Inside the Row’s Content material subject material tab, click on on Practice Development Template and pick the second template underneath Masonry.
Inspect The Masonry Settings
The template applies various Layout settings. Open the Row’s Design tab to check out them.
- Collection of Columns: 4
- Offset Regulations: Two rules, one for spanning all the way through rows and one for spanning all the way through columns.
The Offset Regulations do loads of the artwork in this layout.
Rule 1: Span Every 6n+1 Products Right through Rows
The principle rule uses the ones settings:
- Admin Label: Auto-generated from the rule of thumb of thumb settings, paying homage to 6n+1 Items Span 2 Rows.
- Objective Offset: Custom designed nth-child Rule, with the craze set to 6n+1. This fits the primary products, then every 6th products after that: 1, 7, 13, and so on.
- Offset Rule: Row Span. This changes what choice of row tracks the focused products occupies.
- Offset Value: 2. This makes every focused products take in two row tracks as an alternative of one.
Be told top to bottom, the rule of thumb of thumb says: function items 1, 7, 13, and onward, and make every one two instances as tall. This creates the tall anchor products initially of every workforce of six.
Rule 2: Span Every 6n+6 Products Right through Columns
The second rule works on the other axis.
- Admin Label: Auto-generated from the rule of thumb of thumb settings, paying homage to 6n+6 Items Span 2 Columns.
- Objective Offset: Custom designed nth-child Rule, with the craze set to 6n+6. This fits the 6th products, then every 6th products after that: 6, 12, 18, and so on.
- Offset Rule: Column Span. This changes what choice of column tracks the focused products occupies.
- Offset Value: 2. This makes every focused products span two column tracks as an alternative of one.
The two rules artwork in a lot of dimensions. The principle stretches the principle products in every workforce of six vertically. The second stretches the whole products in every workforce of six horizontally.
Must you copy the Divi Columns until you will have 12 common items, you’ll see how the rules repeat every six teenager items.
Make The Masonry Layout Responsive
The masonry pattern works smartly on desktop, on the other hand a 4-column grid with higher anchor items can actually really feel cramped on smaller shows. That’s the position responsive Grid settings change into crucial.
Grid settings in Divi 5 can also be adjusted all the way through breakpoints. On tablet and make contact with, we can simplify the layout thru overriding the desktop configuration.
Tablet Grid Settings
Switch the Visual Builder to Tablet view and open the Row’s Layout selection workforce. Make two changes:
- Set Collection of Columns to 2.
- Trade the Offset Value on each and every Grid Offset Regulations from 2 to 1 at the tablet breakpoint.
Setting Row Span to 1 on the 6n+1 rule and Column Span to 1 on the 6n+6 rule effectively neutralizes the desktop masonry affect on tablet.
The focused items nevertheless have compatibility the rules. On the other hand, they span the same amount as every other products. The outcome’s a cleaner 2-column grid where every products occupies the same amount of space.
Phone Grid Settings
Switch to Phone view and set Collection of Columns to 1. When you’ve got not overridden the tablet offset values another time on phone, those tablet values will continue downward by way of Divi’s responsive inheritance.
Every products now stacks vertically in a single column.
A Development Template will give you a formidable place to begin. The Layout selection workforce exposes the settings the template applies. For the reason that ones settings can also be adjusted all the way through breakpoints, you’ll use further sophisticated Grid layouts on desktop and simplify them for smaller shows.
Wrapping Up
CSS Grid in Divi 5 makes it more straightforward to build layouts that can have been difficult to create with usual column buildings on my own. In this lesson, the an identical six Columns of content material subject material have been reshaped 3 different ways the use of row-level Grid controls.
First, we applied a basic Development Template. Then, we used a template with Grid Offset Regulations. In spite of everything, we created a masonry-style template with responsive overrides.
Where To Use This Next
You’ll prolong the an identical approach in loads of directions. Bins can change into grids. Development Templates get a hold of tested starting problems. Grid Offset Regulations turn position-based not unusual sense into reusable patterns that can continue running as further teenager items are added.
That final point is especially useful for dynamic content material subject material and Loop Builder layouts, where the choice of items would perhaps industry through the years.
In Section 12: Making Your Divi 5 Web site Completely Responsive, we’ll take everything built to this point and refine it all the way through breakpoints. That contains the Flexbox layouts from Section 10, the CSS Grid layouts from this section, typography, spacing, and templates.
The aim is to make all of the website dangle up from huge desktops to small phones.
The post Phase 11: Mastering CSS Grid In Divi 5 gave the impression first on Chic Subject matters Weblog.





0 Comments