So, sometimes you don’t have that many items to show in a gallery, say two or three. In this case, you’ll find that that the Divi Gallery Module automatically left aligns which doesn’t always look so good. If you like me have been in that position and need to center align it, then here’s a super easy tutorial to help you do just that.
This is all the CSS you’re going to need.
Where It Goes
Adding the CSS is quite easy. If you’re only going to need this for one or two pages on your site, you can add it at page level by adding it to the Custom CSS field in the Page/Post Settings window. To do this, simply open the settings (use the gear icon in the Visual Builder) and then navigate to the Advanced tab and add the CSS to the Custom CSS field.
If you’re using the backend builder, click on the hamburger on the top bar to open the Divi Builder Settings window and add the CSS to the Custom CSS field there.
If you are going to use this more extensively then the best would be to add it to the style.css file of your child theme. If you don’t have a child theme, they’re really easy to create but if you’d prefer not to build it yourself, the good folk over at divi.space have a nice child theme builder that will have you up and running in no time.
Wrapping It Up
Couldn’t be easier (unless Elegant Themes built this into the Gallery Module). Go ahead, center those sparse Gallery Modules and make that page look so much better.
Support Divi Notes
Divi Notes started as a way to document my own WordPress and Divi web design/development journey and, to my delight, has grown to become a helpful resource to many other Divi users out there. If you’ve found Divi Notes to be useful in your journey, I’d appreciate it if you would consider supporting me using the form below.