CSS Grid provides you with two-dimensional regulate so you’ll position pieces precisely the place they belong, as a substitute of combating stacks and columns. It’s like giving your web page a easy map the place you’ll drop facets into transparent spots and let the grid maintain the structure.
On this put up, you’ll learn to use grids in WordPress and why Divi 5 makes the method visible, rapid, and versatile. In a position to construct layouts that really feel designed, no longer simply stacked? Let’s dive in.
What Is CSS Grid Precisely
CSS Grid is a structure device for arranging content material on internet pages the use of rows and columns concurrently. You might want to all the time construct those layouts through nesting bins and the use of floats or different workarounds, however Grid makes the method cleaner and more uncomplicated.
You practice Grid to a container, and it divides the distance into rows and columns. The container turns into a grid, and its direct youngsters turn into grid pieces that sit down within the cells.
You regulate the scale of each and every row and column. Cause them to all of the identical dimension. Or make some larger than others. Combine fastened sizes with versatile ones.
You put up the construction as soon as on your CSS. Then you definately position pieces the place you wish to have them. No wish to stack bins within bins anymore.
Including A Grid To WordPress
CSS Grid became internet layouts into one thing you have to design as a substitute of hacking in combination. WordPress now helps grids, as do the preferred WordPress web page developers. Figuring out your choices is helping you select the best way for what you’re construction. Let’s discover:
The usage of Gutenberg
WordPress features a Grid block (a variation of the Crew block). You’ll be able to insert it with /grid or by the use of the block inserter.
The Grid gives two modes. Auto calculates columns from a minimal column width you place. Guide makes use of a hard and fast column depend and allows you to position blocks in particular cells.
Controls reside within the block sidebar. Make a choice a method, set column depend or minimal width, and modify row/column gaps. Pieces can span more than one cells (e.g., a header throughout 3 columns with playing cards underneath). Blocks within the grid get measurement controls. Make a choice any block, open Dimensions, and set what number of columns/rows it spans. On-canvas handles additionally help you resize through dragging.
Why Gutenberg Isn’t Preferrred For Making Grids
Nice for easy layouts, however there are limits. There’s no local UI for various column counts in keeping with breakpoint, and fine-tuning cellular spacing regularly calls for customized CSS.
Guide mode makes use of a hard and fast column depend, so stacking/wrapping isn’t computerized. When you use Guide, believe two or 3 columns or transfer to Auto for smaller displays. Some controls are simple to leave out, and the minimum-width slider might exchange gadgets as you modify it.

When columns cave in, content material doesn’t all the time fill to be had area, which is able to depart gaps at positive sizes. Blending Auto with fastened column settings will also be complicated, and a few blocks don’t all the time resize reliably. There are not any particular row-height controls within the elementary UI, and there’s no UI for grid-template-areas within the Grid block.
The usage of In style Web page Developers
Elementor and Bricks Builder sit down on the best of the WordPress web page builder marketplace. They’ve constructed huge person bases and get common updates. When those gear added CSS Grid make stronger, it gave the look of the solution everybody sought after. Let’s see how that in truth performs out.
The usage of Elementor
Elementor added Grid Boxes in fresh updates. You turn on the function via Settings, then choose Grid when including a brand new container.

The interface means that you can set column and row counts, modify gaps, and different elementary settings. By means of default, each and every grid cellular holds one widget; to put more than one pieces in a cellular, nest a Container within it.
The usage of Bricks
Bricks Builder helps CSS Grid as neatly. Make a choice any part (phase, container, block, or div), open its settings, and alter the Show assets to grid. That part turns into your grid container.

You outline construction via grid-template-columns and grid-template-rows fields the use of usual CSS values. Sort “1fr 1fr 1fr” for 3 equivalent columns or “200px 1fr 2fr” to combine fastened and versatile sizing. Hole controls maintain spacing between cells.
Grid pieces get Grid Column and Grid Row controls for exact positioning the use of CSS grid line numbers. Auto-placement settings decide how pieces go with the flow whilst you don’t specify positions manually.
The place Those Choices Vary (and Their Limits)
Each developers way CSS Grid inside of their present frameworks, which impacts the way you construct positive patterns.
Elementor’s Grid Container treats each and every cellular as a unmarried part. If you wish to have more than one pieces in a single cellular, you’ll nest a Container within that cellular to carry them. This works, nevertheless it provides an additional layer to regulate in additional advanced layouts.

To put more than one widgets in one grid cellular in Elementor, upload a nested Container within that cellular.
For extra complicated preparations, exact spanning, responsive tweaks in keeping with breakpoint, you should still succeed in for some customized CSS in Elementor.
Bricks means that you can convert any phase/container/block/div to a Grid through surroundings Show to grid, then outline construction with usual CSS homes (grid-template-columns/rows, gaps, and line-based placement). It really works neatly, nevertheless it assumes some familiarity with CSS Grid terminology and values.

How Divi 5 Handles CSS Grid
1000’s of WordPress websites run on Divi presently. It really works as each a theme and a visible web page builder, designed for somebody who needs a qualified website online however doesn’t need to write code or care for WordPress’s awkward block editor.
Divi 5 takes issues to a brand new stage. As an alternative of patching up the outdated device, we began contemporary. All of the theme is now powered through fashionable internet requirements, which means that you recuperate pace and extra regulate over your designs.
Shortcodes are out. Blocks, Grids, and Flexbox are in. This transfer approach your pages best load what they want, so the whole thing runs quicker. Your web page remains cleaner, too. Plus, those structure methods put you in command of spacing, alignment, and the way the whole thing suits in combination. Development sophisticated layouts turns into so much more straightforward this manner.
You maintain the whole thing on the container stage. Select what number of columns and rows you wish to have. Set their sizes. Area them out then again you want. Then drop your content material in, and it fills the grid in keeping with your setup. You’ll be able to create just about any structure this manner.
What’s New In Divi 5?
The Grid device represents only one piece of what makes Divi 5 other. We rebuilt all of the platform from scratch, which means that you get enhancements around the board that have an effect on how you’re employed each unmarried day.
Right here’s what else modified:
- The Inspector aggregates all colours, fonts, sizes, photographs, and presets from any part and its youngsters into one panel. Click on a bit, see each colour used during, then exchange them all of sudden. Proper-click the rest and choose Investigate cross-check to open it.
- Customized Attributes upload any HTML characteristic to facets and sub-elements. You’ll be able to now come with alt textual content, identify tags, rel attributes, aria-labels, and accessibility markers with out touching code.
- Loop Builder pulls content material from any put up sort dynamically. Works with WooCommerce merchandise, ACF fields, customized put up sorts, and repeater fields. You’ll be able to loop the rest, no longer simply predefined loop modules, and nest loops within different loops.
- WooCommerce Modules come with many product-focused modules for customized product pages and class grids. Cart and checkout modules also are to be had.
- Relative Colours and HSL make colour control mathematical. Set a base colour, then create lighter and darker variants that modify routinely. The HSL sliders regulate hue, saturation, and lightness independently for exact colour relationships throughout your web page.
- Integrated Interactions maintain popups, mouse results, scroll animations, and toggle switches with out plugins.
Past Those, High quality Of Lifestyles Enhancements Come with:
- Responsive Editor displays how settings behave throughout other display screen sizes, hover states, and sticky positioning. Transfer between states with out opening separate controls.
- Seven Responsive Breakpoints exchange the outdated three-breakpoint device. Set customized values for each and every one or use defaults. Layouts adapt to telephones, capsules, and desktop screens with out media queries.
- Design Variables retailer colours, fonts, spacing values, photographs, and textual content as soon as. When a variable is modified, each part the use of it updates routinely.
- Nested Rows stack rows within different rows as deep as wanted for advanced mag layouts or portfolio grids.
- Complex Gadgets paintings via visible controls. Sort clamp(), calc(), min(), or max() values with out a stylesheet.
And a lot more. We can be introducing extra options within the coming weeks. For now, let’s see how you’ll construct Grids the use of Divi 5 and why it makes it higher than the choices we mentioned:
Development A Grid In Divi 5
Development a grid typically approach wrestling with settings you don’t perceive or accepting a template that just about works. Divi 5 provides you with each pace and precision. Right here’s the way to arrange a grid that in truth does what you wish to have.
Beginning With Grid Templates
Divi 5 contains ready-made grid templates. Simply click on at the plus icon, browse in the course of the visible previews, and select one.
It applies immediately. Drop modules in, and so they comply with the development routinely for the reason that grid lives on the container stage.
You’ll be able to switch templates anytime or transfer to guide controls for customized paintings.

You’ll be able to additionally convert present layouts to Grids. Select a Segment, Row, Column, or Module Crew within the Visible Builder. Open its settings and pass to the Design tab. Search for Format close to the highest and click on the Format Taste dropdown. Make a choice Grid.

Controlling Grid Construction
You’ll be able to regulate the respiring room between your grid pieces, with Horizontal Gaps surroundings the space between columns and Vertical Gaps dealing with the distance between rows.
Each fields settle for usual gadgets like fastened pixel values when you wish to have actual spacing, relative gadgets like rem or em that scale together with your typography, or share values that reply to container width.

Design Variables make spacing control more straightforward throughout all your web page through letting you save usual hole values as Quantity Variables. Then, click on the dynamic content material icon in both hole box to make a choice your stored variable.

Replace the variable as soon as, and each grid the use of it adjustments routinely without having to trace down particular person settings.
Subsequent up, Column Width determines how broad each and every vertical monitor turns into.

Equivalent Width splits area frivolously throughout all tracks. Equivalent Minimal Width units a ground worth however shall we columns develop when area lets in.
Likewise, Equivalent Mounted Width locks the whole thing on the actual pixel size. Auto Width sizes tracks in keeping with their content material, so a column with a big symbol will get extra space than one with brief textual content.
Guide Width means that you can sort customized patterns like “3fr 3fr 2fr” or combine gadgets like “300px 1fr 1fr”. fr in CSS Grid means that you can inform the browser how a lot area each and every row or column will have to take. As an example, 1fr and 2fr imply the second one column will get two times as a lot area as the primary.

When you select your width mode, the Collection of Columns tells the grid what number of tracks to construct. Pieces fill throughout one row, then wrap down to begin the following.
Cave in Empty Columns cleans up dynamic layouts. Empty columns disappear routinely, and the grid shifts the whole thing over and closes the gaps.

Adjusting Grid Conduct
Your grid wishes to evolve when content material doesn’t fit the construction you’ve arrange. Perhaps you outlined 3 columns, however an merchandise leads to a fourth spot, or your rows want other top remedies. Those settings maintain the ones eventualities and regulate how pieces go with the flow in the course of the grid.
Grid Auto Columns and Grid Auto Rows decide the scale of overflow tracks when pieces land past your outlined columns or rows. Use 200px, 1fr, or auto.
Row Heights gives 4 choices: Auto adjusts to content material, Equivalent makes them uniform, Minimal units a baseline, and Mounted locks them at a worth.

Collection of Rows and Grid Auto Rows just do what their Column opposite numbers do, however for rows.
Grid Route determines how pieces go with the flow. Row mode works horizontally, then down for many layouts. Column mode stacks vertically, then strikes proper for timelines or vertical lists.
Grid Density controls whether or not pieces shuffle to fill gaps. Dense mode packs them tight, and auto mode maintains file order.

When you’ve constructed your grid construction, you want to put the whole thing. Justify Content material strikes your grid horizontally: Get started, Middle, Finish, Area Between, Area Round, or Area Lightly.
Align Pieces controls vertical positioning: best, center, backside, or stretched. Justify Pieces works horizontally: left, middle, proper, or stretched. Align Content material positions the grid vertically when more space exists.

Atmosphere Up Offsets
Grids fill pieces so as through default. First merchandise lands within the first cellular, 2nd merchandise in the second one cellular, and so forth. Grid Offset Laws ruin pieces out of that computerized go with the flow and help you regulate particular person pieces manually.
You select which pieces to focus on, make a selection what assets to use, after which set the price.
Goal choices come with First Merchandise, Ultimate Merchandise, Even Pieces, Extraordinary Pieces, or patterns like Each 3rd Merchandise. You’ll be able to additionally write customized nth-child selectors for advanced patterns.
When you’ve picked your goal, choose the valuables. Column Span and Row Span regulate merchandise dimension through making them stretch throughout more than one cells. Column Get started, Column Finish, Row Get started, and Row Finish regulate exact positioning through pinning pieces to precise grid traces.
Transferring Pieces Across the Grid
You’ll be able to rearrange grid pieces through dragging them round within the Visible Builder. Open the Content material tab, seize an merchandise, and drop it in a brand new spot. The grid updates instantly.
You’ll be able to click on the breakpoint icons to set other desktop, pill, and cellular sequences.

Maximum grid settings modify in keeping with gadget, too. Column Width will also be 4 equivalent columns on desktop, two on pill, and one on cellular. The responsive controls additionally settle for device-specific values for the selection of Columns, Row Heights, and alignment choices.
Growing Presets
When you construct a grid construction that works neatly, you’ll need to use it once more on different pages. Presets help you save and practice your grid configuration anywhere you want that very same structure.
Divi 5 gives Possibility Crew Presets to seize particular surroundings teams, like spacing or column configuration. Click on the preset icon subsequent to any surroundings workforce, give it a transparent title, and put it aside.

On every occasion you wish to have to use the similar settings to a Grid, you’ll get admission to your preset through clicking at the identical icon and settling on the preset you created.
Those presets replace globally. Regulate a preset as soon as, and each part the use of it adjustments routinely. You’ll be able to nonetheless modify particular person cases with out breaking the unique preset.
Check out Divi 5’s Grid Format Machine Nowadays
CSS Grid works another way throughout WordPress gear. Gutenberg provides you with the fundamentals however sends you to customized CSS for actual regulate. Elementor and Bricks upload bins and uncooked code when layouts get advanced.
Divi 5 provides you with visible templates, drag-and-drop, and responsive controls that seem the place wanted. The time saving displays up whilst you save a grid construction as an Possibility Crew Preset, attach choices to Design Variables, and watch your spacing replace throughout 50 pages concurrently when made. You construct a design device as a substitute of copying settings between tasks.
Obtain Divi 5 and construct grids that paintings the way in which you suppose they will have to!
The put up How To Use CSS Grid In WordPress gave the impression first on Chic Topics Weblog.
WordPress Web Design