Key points
- In Divi 5, give each image its own column in one Flex row and they sit side by side.
- Layout Wrapping and Column Class decide how many images fit on each line.
- Aspect Ratio and Object Fit fix images of different heights.
- You can choose per screen size whether images stay in a row or stack.
- A short CSS class is the fallback for older Divi 4 layouts.
In this article9 sectionsHideShow
How do you put images side by side in Divi?
In Divi 5, give each image its own column in one row, then set the row to Flex with a Row layout direction. Divi places the images next to each other with no code.
If you want one rule that works on many pages, a short CSS class on the row does the same job. Both methods are below, with fixes for the problems people meet most.
Elegant Themes explains that Flex is now the default layout for new elements in Divi 5, while existing Divi 4 elements stay on Block. You can switch between the two at any time in the Design tab, under Layout.
Menu names can change a little between Divi 5 versions. If a label looks different on your screen, search the settings panel for its name.
Which method suits your page?
Pick the method by how many images you have and how your page was built.
| Your situation | Best method | Why |
|---|---|---|
| Two to four images of similar size on a new page | One column per image in a Flex row | No code, and every setting is in the Divi panel |
| More images than fit on one line, such as six | Flex row with Layout Wrapping and Column Class | Wrap moves extra images onto the next line |
| Images already stacked in one column on an older Divi 4 page | CSS class on the row | One rule can serve many pages |
| A blog post written in the WordPress block editor | Gallery or Columns block | Both are built into WordPress |
Our view is to use the no code method first. Elegant Themes documents the settings used in it, so you can see what each one does. The CSS method is the fallback.
How do you align images in a row in Divi 5 without code?
Follow these steps for three images. They work the same way for two or four.
- Add the row: add a Section, then add a Row and choose the three equal columns structure. To add or change columns later, open the Row, go to the Content tab and use Add New Column (Elegant Themes, The Row in Divi 5).
- Add one image per column: add an Image module to each column and choose your pictures. If all your images sit in one column now, drag each one into its own column.
- Fill the column: open each Image module, go to the Design tab, then Sizing, and set Width to 100%. Elegant Themes says Width accepts units such as pixels and percentages.
- Check the row layout: open the Row, go to the Design tab and expand Layout. Make sure Flex is selected and the Layout Direction is Row, so the columns run left to right.
- Add space between images: in the same Layout group, set the Horizontal Gap. Elegant Themes describes it as the control for the horizontal space between flex items.
- Preview every screen size: switch between Desktop, Tablet and Phone in the responsive menu and look at the row on each one.
For example, a florist who wants three bouquet photos in a row on a wedding flowers page would choose the three equal columns structure and add one photo to each column. They would set each photo to 100% width and add a small Horizontal Gap.
If the florist later adds three more photos, each in its own new column, a second line is needed. Set the row's Layout Wrapping to Wrap, then give every column the Column Class 1/3. Under Design, Sizing, Elegant Themes lists Fullwidth, 3/4, 2/3, 1/2, 1/3, 1/4 and 1/6 as the options, and says a column keeps its class after it wraps.
Elegant Themes states that Column Class is only available for columns. Give each image its own column so you can use it.
How do you put images in one row with CSS in Divi?
Use CSS if your page keeps its older Divi 4 layout, or if you want one rule for many pages. Divi's own Divi 5 FAQ, dated 2 March 2026, says custom CSS and custom code "should continue to work", with some changes possible if the code depends on internals that have changed.
The code below targets the .et_pb_image class on Image modules. We have not tested it on every Divi 5 release, so preview the page before you publish.
Step 1: add a class to the row
Open the row's settings and go to the Advanced tab. In Divi 5, classes live in the Attributes group. Elegant Themes shows how to choose Add Attribute, set the name to class and set the value to your class name.
On a Divi 4 site, type the same value into the CSS Class field under CSS ID and Classes. Use this class name in either place.
images-under-text
The picture below shows the CSS Class field in Divi 4, here in a column's settings. The class works on the row or on the column that holds the images.

Step 2: paste the CSS into Theme Options
In your WordPress dashboard, go to Divi, then Theme Options, then the General tab and find Custom CSS. Elegant Themes says CSS added there applies site wide.
To limit the rule to one page, open that page's Page Settings, go to the Advanced tab and use its Custom CSS box instead.
.images-under-text .et_pb_image {
display: inline-block; /* Puts the image modules side by side */
width: 32%; /* A little under one third leaves room for small gaps */
vertical-align: top; /* Lines up the tops of images with different heights */
box-sizing: border-box; /* Counts padding and border inside the width */
}
.images-under-text .et_pb_text {
width: 100%; /* Keeps a text module full width above the images */
margin-bottom: 20px; /* Adds space between the text and the images */
}
@media (max-width: 767px) {
.images-under-text .et_pb_image {
width: 100%; /* Stacks the images on small screens */
}
}
The first rule puts each image module on the same line. The second rule only matters if a text module sits in the same column above the images, and you can delete it if there is none.
The last rule makes every image full width on small screens. Change 767px if your design needs a different cut off point for stacking.
If the CSS seems to do nothing, check that the class name matches in both places and that you saved the page. If you use a caching plugin, clear it too, as our guide to LiteSpeed Cache settings for Divi explains for that plugin.
Once the images sit in one row on desktop, test the same page on a phone before you move on.
Free call
Want more enquiries from Google?
Book a free call and we'll look at your site with you, then show you what's holding it back.

The picture above shows the code pasted into the Custom CSS box in Divi Theme Options. It is an earlier screenshot, so copy the code from this guide and not from the picture.
Why are my Divi images not lining up in a row?
| What you see | Likely cause | What to change |
|---|---|---|
| Images still stack in one column | All images sit in one column, or the row is on Block layout | Give each image its own column. In the Row's Design tab, Layout group, choose Flex and Layout Direction Row |
| The last image drops onto a new line | The widths add up to more than one line, or Wrap is on | Choose Column Class values that fill one line, or keep Wrap on if you want a second line. With CSS, lower the width a little |
| Images are different heights | The original photos have different shapes | Set an Aspect Ratio under Design, Sizing, then set Object Fit to Cover under Framing |
| Images sit at different levels in the row | Vertical alignment in the row | Set Align Items in the Row's Layout group. Start lines up the tops |
| Too much or too little space between images | Gap settings | Change Horizontal Gap and Vertical Gap in the Layout group |
| Text moves down as images load | The page does not know the image shape in advance | Set an Aspect Ratio so the browser knows the image shape |
| A gap appears under the header | A different problem | Read our guide to removing white space under a Divi header |
On uneven heights, Elegant Themes explains that Aspect Ratio lives under Design, Sizing, and that Object Fit has three values. Cover "fills the frame while preserving proportions, cropping the overflow". Check that no face or product is cut off.
MDN, the web standards reference, describes the cover value in the same way. The image keeps its shape and is clipped to fit its box.
For vertical alignment, Elegant Themes writes that Align Items controls alignment along the cross axis. In a row, that means up and down.
On layout shift, web.dev advises that you "always include width and height size attributes" on images, or reserve the space with CSS aspect-ratio (web.dev, last updated 7 February 2025). Divi's Aspect Ratio setting sets a width to height ratio, which gives the browser the shape to plan for.
If a layout still will not behave, you can read about our Web Design service.
How do you keep images side by side on mobile in Divi?
Divi lets you set each screen size on its own. Switch to Phone in the responsive menu, then change the row's Layout Direction or the columns' Column Class for that size only.
Elegant Themes notes that most designers keep Row on desktop and change to Column on tablets and phones. That stacks the images, one above the other.
To keep several lines on a tablet, use Column Class with Wrap. In its eight column example, Elegant Themes sets 1/4 per column on tablet and Fullwidth on phone.
For example, a florist with four photos could keep four across on desktop, use 1/2 per column on tablet with Wrap on for two lines of two, and use Fullwidth on phone. Our view is to stack large photos on a phone so each one stays easy to see. Small logos or icons can stay in a row.
Divi follows the source order of the layout on smaller screens, as Elegant Themes states. The first column in your row will be the top image when they stack. Check each size with the steps in Elegant Themes' guide to responsive Divi 5 sites.
How do you put images side by side in the WordPress block editor?
If your post uses the WordPress block editor, you have two built in options. They suit blog posts and simple pages.
The Gallery block lets you add several photos and arrange them in columns. WordPress.org says you can choose one to eight columns, up to the number of images. Turn on the crop option to make the images in each row the same size.
The Columns block gives you one to six columns, and you can put an Image block in each one (WordPress.org, Columns block). Its Stack on mobile setting is on by default, so the columns stack on small screens until you switch it off.
To place a single image, open the block inserter, search for the Image block and add it, or type /image on a new line and press Enter. The WordPress.org Image block guide lists these alignment choices: none, wide width, full width, align left, align centre and align right. Wide and full width show only if your theme supports them.
What image size and alt text should you use?
Use an image about as wide as its largest display size, and compress it before you upload. Our guide on how to compress your images without losing quality shows the steps. For alt text, file names and the best format, use our image optimisation checklist.
For alt text, Google Search Central says it is the most important attribute for giving an image more metadata. It also advises against filling alt attributes with keywords and recommends short, descriptive file names. Its page was last updated on 2 March 2026.
In Divi 5, Elegant Themes says the Image module can pull alt and title text from the WordPress Media Library when they are set there. Writing the alt text once in the Media Library can save you doing it for each module. For more on keeping pages light, see our guide to speeding up WordPress.
Common questions about images in a Divi row
Do I need CSS to put images in one row in Divi?
No. In Divi 5, give each image its own column in a row, check the row is on Flex with a Row layout direction and set the gap. CSS is a fallback for older Divi 4 layouts, or for one rule across many pages.
How do I put two images side by side in Divi?
Add a row with two equal columns and put one Image module in each. Set each module's Width to 100% so it fills its column. If you want exact control, set the Column Class of both columns to 1/2 in the Design tab under Sizing.
Will the images swap places on mobile?
No. Divi follows the source order of the layout on smaller screens, so the first column stays on top when the columns stack. If you want a different order on a phone, set it in the first column's Content tab under Order, using the Display Order setting.
Does image alignment affect my Google rankings?
Google's image guidance covers alt text, short descriptive file names and good quality images. It does not list image alignment. Alignment is there for your visitors, so judge it by whether the row looks tidy and each image is easy to see on a phone and a desktop.
Preview your row on desktop, tablet and phone before you publish, so you see it the way your visitors will.

