Designing a format comes to putting bins on a web page and making sure they continue to be aligned when the display screen measurement adjustments. For years, that intended running round obstacles — floats, guide spacing, or construction the whole thing in a single course.
CSS Grid adjustments the sport. Rows and columns serve as as a unmarried device, permitting galleries, product grids, and workforce sections to come back at the side of much less effort and hang up higher over the years. On this put up, we’ll stroll you in the course of the fundamentals of Grid and display you ways Divi 5‘s Grid makes it visually interesting.
What Is CSS Grid?
Call to mind CSS Grid like a spreadsheet to your format. You put up rows and columns, and the whole thing suits into cells. Some goods are confined to at least one mobile, whilst others span a number of. The construction holds, providing you with blank alignment with out margins or positioning hacks.
Right here’s the way it works: You outline a container because the grid, and the whole thing within turns into a grid merchandise. Rows run horizontally, columns vertically.

The distance between them is known as the space. You keep watch over it at once as a substitute of including padding or further divs to faux spacing.
You’ll outline each and every row and column your self for complete keep watch over, or let the browser create rows mechanically as content material fills the distance. Each approaches are efficient, relying at the format’s wishes.
Grid brings one thing that older strategies couldn’t do neatly: rows and columns running as one device. Prior to Grid, you’d align goods in a single course at a time the usage of floats or inline blocks. That labored for easy layouts, however it were given messy whenever you wanted construction that went each throughout and down the web page.
Grid handles each instructions concurrently, so galleries, product grids, and multi-section pages come at the side of much less code and less workarounds. It’s supported across all modern browsers, so there’s no compatibility guesswork.

CSS Grid vs. Flexbox
Flexbox and Grid get compared frequently, however they resolve other issues.

Flexbox works in a single course at a time (both arranging goods in a row or stacking them in a column). This makes it nice for navigation bars, button teams, or card layouts the place the whole thing traces up alongside a unmarried axis. You keep watch over spacing, alignment, and order, however you’re at all times running inside of that one line of glide.
Grid works in two instructions without delay. You outline rows and columns in combination, and goods can sit down any place within that construction. You’re no longer restricted to a unmarried line. That is the place Grid pulls forward for web page sections, symbol galleries, or dashboards the place content material must align each horizontally and vertically on the identical time.

Grid makes complicated layouts more uncomplicated since you’re no longer stacking one-dimensional techniques on best of one another, hoping they hang in combination. Rows and columns are a part of the similar framework, so spacing remains constant, alignment occurs naturally, and making adjustments doesn’t wreck the entire construction. You outline the format as soon as, position your goods, and the grid helps to keep the whole thing in place because the display screen measurement adjustments.
How CSS Grid Works In Apply
Let’s take a look at how this works in exact code. Beginning a grid takes 3 issues: pointing out the container, defining your columns or rows, and surroundings the space. Right here’s a easy instance:
.container {
show: grid;
grid-template-columns: 1fr 1fr;
hole: 20px;
}
This will give you a two-column grid. Each and every column takes up equivalent area, and there’s a 20px hole between goods. Any kid parts throughout the container mechanically glide into this construction.
The fr unit stands for fractional unit. It divides to be had area into stocks. So 1fr 2fr way the primary column will get one proportion and the second one column will get two stocks. The browser calculates the distance and distributes it proportionally.
You’ll additionally place person goods throughout more than one cells. The grid-column assets controls this. The use of grid-column: 1/3 tells the object to start out on the first vertical line and finish simply sooner than the 3rd line. That spans two complete columns.

Grid comes with a complete set of homes that keep watch over format conduct. Columns, rows, alignment, spacing, and merchandise placement all have their very own controls. Right here’s all the record:
| Belongings | What it Does | Instance Price / Use Case |
|---|---|---|
| show: grid | Turns the container right into a grid format. | show: grid; |
| grid-template-columns | Defines what number of columns and their widths. | grid-template-columns: 1fr 2fr; |
| grid-template-rows | Defines what number of rows and their heights. | grid-template-rows: auto 200px; |
| grid-template-areas | Creates named grid places for more uncomplicated placement. | header header” “sidebar major” |
| hole (or grid-gap) | Units the spacing between rows and columns. | hole: 20px; |
| justify-items | Aligns content material horizontally within each and every mobile. | justify-items: middle; |
| align-items | Aligns content material vertically within each and every mobile. | align-items: get started; |
| grid-column | We could an merchandise span throughout more than one columns. | grid-column: 1 / 3; |
| grid-row | We could an merchandise span throughout more than one rows. | grid-row: 2 / 4; |
CSS Grid In Divi 5
Writing CSS Grid by means of hand calls for figuring out the syntax, memorizing assets names, and trying out code to make sure it really works. For builders, that’s manageable. For designers, content material creators, or any individual construction websites visually, it’s a barrier. You both skip Grid or spend time finding out code that attracts you out of the design procedure.
Divi 5 eliminates that barrier. The core CSS Grid homes were transformed into a visible keep watch over throughout the builder. Defining columns, adjusting gaps, and spanning goods throughout cells can all be carried out via choices which can be visual and clickable. You’re making use of the similar Grid homes builders use, however you’re doing it visually.
This means builds on how Divi handles format total. Flexbox is the foundation as it covers maximum on a regular basis format wishes with blank, environment friendly CSS. It handles alignment, spacing, and responsiveness neatly for single-direction designs.
Grid sits on best as an non-compulsory layer. When a bit calls for construction in two instructions (rows and columns running in combination), you permit Grid and achieve that keep watch over with out leaving the visible editor. It additionally works with the responsive editor and customizable breakpoints.
You’ll outline other column counts, gaps, or merchandise spans for desktop, pill, and cell. The builder presentations each and every breakpoint as you design, permitting changes to happen in context moderately than via separate media queries.
The result’s a device that moves a steadiness between pace and versatility. Flexbox helps to keep commonplace layouts light-weight and rapid to construct. Grid steps in when you want actual, multi-directional construction. Each paintings within the similar visible workflow, so that you’re no longer switching between equipment or writing customized code to get entry to complicated format options.
What makes this means paintings is that you just’re construction visually all the time. There’s no back-and-forth between the builder and a code editor. No trying out within the browser to peer if a assets labored. The controls supply instant comments, making prototyping layouts sooner and changes conceivable in actual time. You get the overall energy of CSS Grid without having to put in writing or perceive a unmarried line of CSS.
New Grid Constructions
Enabling Grid in Divi 5 alters the conduct of rows and sections. You’re now not restricted to goods flowing in a single course. Columns, rows, offsets, and sizing patterns change into a part of the format construction, letting you keep watch over precisely the place each and every part sits and what sort of area it takes.

Modules align to the grid mechanically. Gaps regulate in accordance with your settings. Pieces practice the sizing laws you outline, so there’s no wish to upload guide margins or positioning tweaks to make issues line up. The offset editor provides any other layer of keep watch over by means of letting you create patterns around the grid. You’ll make each and every fourth merchandise span two columns, shift the place goods get started, or get a divorce visible repetition so as to add rhythm to the format.
How It Works
Getting began takes one step. Allow the Grid possibility on any part, row, column, or workforce.

As soon as the Grid is lively, you outline the selection of columns and rows the usage of fractional devices or repeat patterns. The controls mean you can set versatile sizing, so columns and rows regulate in keeping with to be had area.

After that, you regulate the space between goods, set alignment, and use merchandise spanning when you wish to have sure modules to stretch throughout more than one cells.
You’ll get started with a pre-built grid template if you wish to have a format able to head. Drop for your modules, and the construction is already set. Or you’ll outline rows and columns from scratch, regulate the gaps, and come to a decision which goods span more than one cells to create emphasis. The builder handles the CSS, so that you’re running visually all the time.
Sensible Use Instances In Divi
Let’s take a look at one of the most maximum commonplace CSS grid examples you’ll be capable of create with out guide coding:
1. Weblog Submit Grids
Weblog grids paintings naturally with Grid layouts, and Divi’s Loop Builder makes them much more sensible. The Loop Builder pulls content material at once out of your posts (titles, excerpts, pictures, and metadata) and mechanically populates each and every grid merchandise. Whilst you submit a brand new put up, apparently within the grid. Whilst you delete one, the format adjusts. There’s no guide updating or rebuilding the format each and every time your content material adjustments.
The offset editor provides flexibility. You’ll make each and every fourth put up span two columns or regulate how explicit goods stretch throughout rows. That breaks up the repetition and offers the grid visible rhythm without having customized code for each and every variation.
This identical means works for any content material that updates continuously. Product grids for WooCommerce stores, portfolio galleries, workforce member sections, or tournament listings get pleasure from the Loop Builder paired with Grid. You design the format as soon as, outline the grid construction, and the content material fills itself in because it adjustments.
2. Symbol Galleries
Symbol galleries display Grid’s structural flexibility. Divi’s grid constructions be offering 3 format choices: multi-row grids, masonry layouts, and sidebar sections.
Usual grids organize pictures in even rows and columns. Masonry layouts permit pictures to stack naturally in accordance with peak, getting rid of awkward gaps that may happen with taller pictures. Sidebar sections position a featured symbol or content material block along a grid of smaller pictures.
Switching between those constructions takes one click on. You don’t must construct each and every format from scratch or write customized CSS to get Masonry running. The grid handles the construction, and also you regulate column counts, gaps, and merchandise spans to check the design you’re after.
3. Web page Layouts
Grid makes it simple to create totally other web page designs by means of adjusting a couple of settings. Alternate the selection of columns and your format shifts from a unmarried content material movement to a multi-column mag format. Modify row spans and an ordinary hero part turns into a layered, uneven design. Regulate gaps and the similar content material feels both tight and editorial or open and minimum.
The controls are living within the settings panel. You’ll set the grid course, regulate column and row dimensions, and fine-tune alignment. Each and every alternate updates the format immediately within the builder, so you notice precisely how the design transforms as you’re employed. Particular person grid goods even have their very own sizing controls, so you’ll regulate width, peak, and place to create layouts that really feel intentional.
Create Grid Layouts With Divi 5 Nowadays
CSS Grid will give you keep watch over over rows and columns concurrently, making advanced layouts cleaner and more uncomplicated to take care of. Then again, the usage of it at once way finding out the syntax and trying out the code.
Divi 5 turns each and every Grid assets into a visible keep watch over. Flexbox handles on a regular basis layouts, whilst Grid steps in for structured, two-dimensional designs. Each paintings within the similar builder. Weblog grids, symbol galleries, and web page layouts change into sooner to construct and more practical to regulate. The construction is constant throughout display screen sizes, and format adjustments happen via settings moderately than customized CSS.
The put up What Is CSS Grid (& Why You Should Use It) gave the impression first on Elegant Themes Blog.
Contents
- 1 What Is CSS Grid?
- 2 How CSS Grid Works In Apply
- 3 CSS Grid In Divi 5
- 4 Sensible Use Instances In Divi
- 5 Create Grid Layouts With Divi 5 Nowadays
- 6 Visual Design Elements And Principles: 2025 Guide
- 7 The Automobile Fireplace That Sparked Hundreds of thousands of Impressions for Stanley
- 8 How you can Show Writer’s Twitter and Fb at the Profile Web page



0 Comments