How To Use CSS Grid In WordPress

by | Oct 26, 2025 | Etcetera | 0 comments

CSS Grid will give you two-dimensional keep an eye on so that you’ll place items exactly the position they belong, instead of preventing stacks and columns. It’s like giving your internet web page a simple map where you’ll drop sides into clear spots and let the grid deal with the construction.

In this publish, you’ll discover ways to use grids in WordPress and why Divi 5 makes the process visual, speedy, and flexible. Able to build layouts that truly really feel designed, now not merely stacked? Let’s dive in.

What Is CSS Grid Exactly

CSS Grid is a construction system for arranging content material subject material on web pages the usage of rows and columns similtaneously. Chances are you’ll need to at all times assemble the ones layouts via nesting boxes and the usage of floats or other workarounds, on the other hand Grid makes the process cleaner and more straightforward.

You apply Grid to a container, and it divides the space into rows and columns. The container turns right into a grid, and its direct children transform grid items that take a seat down throughout the cells.

You keep an eye on the size of every row and column. Lead them to all the an identical measurement. Or make some greater than others. Mix fixed sizes with flexible ones.

You place up the development once for your CSS. Then you definately definately place items where you want them. No need to stack boxes inside of boxes anymore.

Together with A Grid To WordPress

CSS Grid turned into web layouts into something you need to design instead of hacking together. WordPress now is helping grids, as do the most popular WordPress internet web page builders. Understanding your alternatives helps you choose one of the simplest ways for what you’re building. Let’s uncover:

Using Gutenberg

WordPress includes a Grid block (a variation of the Group block). You’ll have the ability to insert it with /grid or by means of the block inserter.

The Grid offers two modes. Auto calculates columns from a minimum column width you put. Information uses a difficult and rapid column rely and lets you place blocks particularly cells.

Controls live throughout the block sidebar. Make a selection one way, set column rely or minimum width, and regulate row/column gaps. Items can span multiple cells (e.g., a header all through 3 columns with taking part in playing cards beneath). Blocks throughout the grid get dimension controls. Make a selection any block, open Dimensions, and set what choice of columns/rows it spans. On-canvas handles moreover can help you resize via dragging.

Why Gutenberg Isn’t Very best For Making Grids

Great for simple layouts, on the other hand there are limits. There’s no native UI for more than a few column counts in line with breakpoint, and fine-tuning mobile spacing incessantly calls for custom designed CSS.

Information mode uses a difficult and rapid column rely, so stacking/wrapping isn’t automated. While you use Information, imagine two or 3 columns or switch to Auto for smaller presentations. Some controls are easy to go away out, and the minimum-width slider may alternate units as you regulate it.

A screenshot of random settings scattered in tabs in WordPress' Gutenberg grid block

When columns collapse, content material subject material doesn’t at all times fill available house, which is in a position to go away gaps at sure sizes. Mixing Auto with fixed column settings can also be sophisticated, and a couple of blocks don’t at all times resize reliably. There aren’t any specific row-height controls throughout the fundamental UI, and there’s no UI for grid-template-areas throughout the Grid block.

Using In taste Internet web page Builders

Elementor and Bricks Builder take a seat down on the most productive of the WordPress internet web page builder market. They’ve built massive individual bases and get not unusual updates. When the ones tools added CSS Grid strengthen, it gave the impression of the answer everyone wanted. Let’s see how that in fact plays out.

Using Elementor

Elementor added Grid Containers in recent updates. You flip at the serve as by way of Settings, then make a selection Grid when together with a brand spanking new container.

See also  8 Best WordPress Reseller Hosting Companies in 2023

A screenshot of the grid element in Elementor

The interface signifies that you’ll set column and row counts, regulate gaps, and other fundamental settings. By way of default, every grid mobile holds one widget; to position multiple items in a mobile, nest a Container inside of it.

Using Bricks

Bricks Builder is helping CSS Grid as well. Make a selection any section (section, container, block, or div), open its settings, and change the Display belongings to grid. That section becomes your grid container.

A screenshot of the how to convert an existing container to grid in Bricks Builder

You define building by way of grid-template-columns and grid-template-rows fields the usage of standard CSS values. Type “1fr 1fr 1fr” for three identical columns or “200px 1fr 2fr” to mix fixed and flexible sizing. Hollow controls deal with spacing between cells.

Grid items get Grid Column and Grid Row controls for precise positioning the usage of CSS grid line numbers. Auto-placement settings make a decision how items glide when you don’t specify positions manually.

Where The ones Alternatives Range (and Their Limits)

Each and every builders manner CSS Grid inside of in their provide frameworks, which affects the best way you assemble sure patterns.

Elementor’s Grid Container treats every mobile as a single section. If you want to have multiple items in one mobile, you’ll nest a Container inside of that mobile to hold them. This works, but it supplies an extra layer to keep an eye on in more complex layouts.

A screenshot of container nesting inside Elementor's grid builder to add multiple elements

To position multiple widgets in a single grid mobile in Elementor, add a nested Container inside of that mobile.

For added sophisticated arrangements, precise spanning, responsive tweaks in line with breakpoint, you must nonetheless achieve for some custom designed CSS in Elementor.

Bricks signifies that you’ll convert any section/container/block/div to a Grid via atmosphere Display to grid, then define building with standard CSS properties (grid-template-columns/rows, gaps, and line-based placement). It truly works well, but it assumes some familiarity with CSS Grid terminology and values.

A screenshot of applying grids in Bricks Builder

How Divi 5 Handles CSS Grid

1000’s of WordPress web pages run on Divi right now. It truly works as every a theme and a visual internet web page builder, designed for anyone who wishes a professional website on the other hand doesn’t wish to write code or handle WordPress’s awkward block editor.

Divi 5 takes problems to a brand spanking new level. Instead of patching up the old-fashioned system, we started fresh. The entire theme is now powered via trendy web necessities, which means that that you just get better tempo and further keep an eye on over your designs.

Shortcodes are out. Blocks, Grids, and Flexbox are in. This switch method your pages best possible load what they would like, so the entire thing runs faster. Your internet web page stays cleaner, too. Plus, the ones construction strategies put you in charge of spacing, alignment, and the best way the entire thing fits together. Construction refined layouts becomes so a lot more simple this way.

You deal with the entire thing at the container level. Make a selection what choice of columns and rows you want. Set their sizes. Space them out alternatively you wish to have. Then drop your content material subject material in, and it fills the grid in line with your setup. You’ll have the ability to create with regards to any construction this way.

What’s New In Divi 5?

The Grid system represents just one piece of what makes Divi 5 different. We rebuilt all the platform from scratch, which means that that you just get improvements across the board that affect the way you’re hired every single day.

Proper right here’s what else changed:

  • The Inspector aggregates all colors, fonts, sizes, images, and presets from any section and its children into one panel. Click on on just a little, see every color used right through, then alternate them all at once. Correct-click the remainder and make a selection Check out to open it.
  • Customized Attributes add any HTML feature to sides and sub-elements. You’ll have the ability to now include alt text, establish tags, rel attributes, aria-labels, and accessibility markers without touching code.
  • Loop Builder pulls content material subject material from any publish kind dynamically. Works with WooCommerce products, ACF fields, custom designed publish varieties, and repeater fields. You’ll have the ability to loop the remainder, now not merely predefined loop modules, and nest loops inside of other loops.
  • WooCommerce Modules include many product-focused modules for custom designed product pages and sophistication grids. Cart and checkout modules are also available.
  • Relative Colours and HSL make color regulate mathematical. Set a base color, then create lighter and darker variants that fluctuate robotically. The HSL sliders keep an eye on hue, saturation, and lightness independently for precise color relationships all through your internet web page.
  • Integrated Interactions deal with popups, mouse effects, scroll animations, and toggle switches without plugins.
See also  8 Tactics To Get New Shoppers For Your WordPress Internet Building Trade…And Stay Them Satisfied!

Previous The ones, Prime quality Of Existence Improvements Include:

  • Responsive Editor presentations how settings behave all through different computer screen sizes, hover states, and sticky positioning. Switch between states without opening separate controls.
  • Seven Responsive Breakpoints alternate the old-fashioned three-breakpoint system. Set custom designed values for every one or use defaults. Layouts adapt to phones, pills, and desktop displays without media queries.
  • Design Variables store colors, fonts, spacing values, images, and text once. When a variable is changed, every section the usage of it updates robotically.
  • Nested Rows stack rows inside of other rows as deep as sought after for complex magazine layouts or portfolio grids.
  • Complex Gadgets artwork by way of visual controls. Type clamp(), calc(), min(), or max() values and not using a stylesheet.

And much more. We will be able to be introducing additional choices throughout the coming weeks. For now, let’s see the way you’ll assemble Grids the usage of Divi 5 and why it makes it upper than the selections we discussed:

Construction A Grid In Divi 5

Construction a grid normally method wrestling with settings you don’t understand or accepting a template that almost works. Divi 5 will give you every tempo and precision. Proper right here’s how one can prepare a grid that in fact does what you want.

Starting With Grid Templates

Divi 5 incorporates ready-made grid templates. Merely click on on on the plus icon, browse during the visual previews, and make a choice one.

It applies in an instant. Drop modules in, and so they agree to the advance robotically given that grid lives at the container level.

You’ll have the ability to transfer templates anytime or switch to lead controls for custom designed artwork.

A screenshot of where to find the change grid structure option in Divi 5

You’ll have the ability to moreover convert provide layouts to Grids. Make a selection a Section, Row, Column, or Module Group throughout the Visual Builder. Open its settings and cross to the Design tab. Seek for Structure as regards to the perfect and click on at the Structure Style dropdown. Make a selection Grid.

A screenshot of the option to change existing layouts to grid with a click in Divi 5

Controlling Grid Development

You’ll have the ability to keep an eye on the breathing room between your grid items, with Horizontal Gaps atmosphere the gap between columns and Vertical Gaps coping with the space between rows.

Each and every fields accept standard units like fixed pixel values when you want exact spacing, relative units like rem or em that scale along side your typography, or percentage values that respond to container width.

A screenshot of the gap settings for a grid in Divi 5

Design Variables make spacing regulate easier all through your whole internet web page via letting you save standard hollow values as Amount Variables. Then, click on at the dynamic content material subject material icon in each hollow field to choose your saved variable.

A screenshot of the how to add grid spaces using global variables in Divi 5

Exchange the variable once, and every grid the usage of it changes robotically with no need to track down specific individual settings.

Next up, Column Width determines how vast every vertical observe becomes.

A screenshot of the where to find the column widths option in Divi 5

Identical Width splits house flippantly all through all tracks. Identical Minimum Width devices a flooring value on the other hand lets columns expand when house shall we in.

Likewise, Identical Fastened Width locks the entire thing on the true pixel dimension. Auto Width sizes tracks in line with their content material subject material, so a column with a large image gets more space than one with temporary text.

Information Width signifies that you’ll kind custom designed patterns like “3fr 3fr 2fr” or mix units like “300px 1fr 1fr”. fr in CSS Grid signifies that you’ll tell the browser how so much house every row or column must take. For example, 1fr and 2fr suggest the second column gets two instances as so much house as the principle.

A screenshot of manual width columns that support frs

When you choose your width mode, the Choice of Columns tells the grid what choice of tracks to build. Items fill all through one row, then wrap down to start out the next.

Collapse Empty Columns cleans up dynamic layouts. Empty columns disappear robotically, and the grid shifts the entire thing over and closes the gaps.

A screenshot of the number of columns and collapse empty columns option in Divi 5

Adjusting Grid Habits

Your grid needs to conform when content material subject material doesn’t are compatible the development you’ve prepare. In all probability you defined 3 columns, on the other hand an products ends up in a fourth spot, or your rows need different most sensible therapies. The ones settings deal with those scenarios and keep an eye on how items glide during the grid.

Grid Auto Columns and Grid Auto Rows make a decision the size of overflow tracks when items land previous your defined columns or rows. Use 200px, 1fr, or auto.

See also  The best way to Use the WordPress Slideshare Embed Block

Row Heights offers 4 alternatives: Auto adjusts to content material subject material, Identical makes them uniform, Minimum devices a baseline, and Fastened locks them at a value.

A screenshot of the grid auto columns and row heights option in Divi 5

Choice of Rows and Grid Auto Rows do just what their Column counterparts do, on the other hand for rows.

Grid Direction determines how items glide. Row mode works horizontally, then down for plenty of layouts. Column mode stacks vertically, then moves correct for timelines or vertical lists.

Grid Density controls whether or not or no longer items shuffle to fill gaps. Dense mode packs them tight, and auto mode maintains record order.

A screenshot of the number of rows, grid auto rows, grid direction and density options in Divi 5

While you’ve built your grid building, you wish to have to position the entire thing. Justify Content material subject material moves your grid horizontally: Get began, Center, End, Space Between, Space Spherical, or Space Flippantly.

Align Items controls vertical positioning: best possible, middle, bottom, or stretched. Justify Items works horizontally: left, center, correct, or stretched. Align Content material subject material positions the grid vertically when more room exists.

A screenshot of the justify content and items and align items and content options in Divi 5

Environment Up Offsets

Grids fill items in order via default. First products lands throughout the first mobile, 2d products in the second mobile, and so on. Grid Offset Regulations wreck items out of that automated glide and can help you keep an eye on specific individual items manually.

You choose which items to concentrate on, choose what belongings to make use of, and then set the cost.

Purpose alternatives include First Products, Final Products, Even Items, Abnormal Items, or patterns like Each and every third Products. You’ll have the ability to moreover write custom designed nth-child selectors for complex patterns.

While you’ve picked your purpose, make a selection the property. Column Span and Row Span keep an eye on products measurement via making them stretch all through multiple cells. Column Get began, Column End, Row Get began, and Row End keep an eye on precise positioning via pinning items to express grid lines.

Shifting Items Around the Grid

You’ll have the ability to rearrange grid items via dragging them spherical throughout the Visual Builder. Open the Content material subject material tab, snatch an products, and drop it in a brand spanking new spot. The grid updates straight away.

You’ll have the ability to click on at the breakpoint icons to set different desktop, tablet, and mobile sequences.

A screenshot of where to find the breakpoint option in Divi 5's interface

Most grid settings regulate in line with system, too. Column Width can also be 4 identical columns on desktop, two on tablet, and one on mobile. The responsive controls moreover accept device-specific values for the number of Columns, Row Heights, and alignment alternatives.

Rising Presets

While you assemble a grid building that works well, you’ll wish to use it yet again on other pages. Presets can help you save and apply your grid configuration anyplace you wish to have that exact same construction.

Divi 5 offers Possibility Crew Presets to snatch specific atmosphere groups, like spacing or column configuration. Click on at the preset icon next to any atmosphere personnel, give it a clear identify, and reserve it.

A screenshot of where to find the option group preset icon in Divi 5's interface for saving the grid presets

On each and every instance you want to make use of the equivalent settings to a Grid, you’ll get entry to your preset via clicking on the an identical icon and settling at the preset you created.

The ones presets change globally. Keep an eye on a preset once, and every section the usage of it changes robotically. You’ll have the ability to however regulate specific individual instances without breaking the original preset.

Take a look at Divi 5’s Grid Structure System These days

CSS Grid works in a different way all through WordPress tools. Gutenberg will give you the basics on the other hand sends you to personalised CSS for exact keep an eye on. Elementor and Bricks add boxes and raw code when layouts get complex.

Divi 5 will give you visual templates, drag-and-drop, and responsive controls that appear where sought after. The time saving presentations up when you save a grid building as an Risk Group Preset, connect alternatives to Design Variables, and watch your spacing change all through 50 pages similtaneously when made. You assemble a design system instead of copying settings between duties.

Download Divi 5 and assemble grids that artwork the best way by which you think they are going to must!

The publish How To Use CSS Grid In WordPress appeared first on Chic Topics Weblog.

WordPress Web Design

[ continue ]

WordPress Maintenance Plans | WordPress Hosting

read more

0 Comments

Submit a Comment

DON'T LET YOUR WEBSITE GET DESTROYED BY HACKERS!

Get your FREE copy of our Cyber Security for WordPress® whitepaper.

You'll also get exclusive access to discounts that are only found at the bottom of our WP CyberSec whitepaper.

You have Successfully Subscribed!