Make Divi Buttons Inline
Solving Another Missing Feature
There are many times you want to place two Divi buttons next to each other, but you just can’t. Sure, you could try adding button modules to different columns, but sometimes that’s not practical. The only way to place two or more button modules side by side in the same column is by using a tiny snippet of CSS. This quick Divi tutorial will show you how!
Add The CSS Code Snippet
We are not actually going to do anything to the Button Module itself, but rather to the colum that the Button Modules are inside. That’s because we need to target the button wrapper, and this is the only way to do that.
Find the row and column where you want to place the buttons. In the column settings, go to the Advanced tab to the CSS Class. Add the class “pa-inline-buttons” and save.
Next, add the following snippet your Divi>Theme Options>Custom CSS box.
/*place button modules next to each other in the same column*/
.pa-inline-buttons .et_pb_button_module_wrapper {
display: inline-block;
}
Add Button Modules
Now you can go ahead and add two or more Button Modules there in that column. They will line up next to each other.
Adjust The Spacing In The Button Modules
Now of course you can adjust the spacing, because by default they will smash right up against each other. I’d recommend going in to the button settings and adding a margin left of 10px or so on the right button.
Center The Buttons In The Column
If you want to center the buttons inside the column, you will need to add an additional snippet of code:
.pa-inline-buttons {
text-align: center !important;
}
I can’t seem to get it to work. pa-inline-buttons
Hi Steve,
I’ll need more details in order to help you! Let me know.
Hi and many thanks for this.
I’m just trying to get the two buttons to be centred in the column and not sure how to do this?
I’ve set the Button Alignment to Center but there doesn’t seem to be an option in the Column Settings to Center content?
I’ve set some vw margin at the moment to move them right and create a space between the two but this is not going to achieve consistent centering across all screen sizes.
Is there any additional css that can be added?
Thanks in advance
Hi Alan,
Sure, just add this snippet also:
.pa-inline-buttons {
text-align: center !important;
}
I’ve updated the post with this!
Fantastic – thank you 🙂
wow wonderful dear
Glad you like it!
I’m having trouble getting this to work on the mobile page. Is that possible?
Hi Brandy, what trouble are you having? Is it due to not having enough space? Might have to make the button text size and padding smaller.
Thank you for fantastic content.
Luckily this worked for three buttons, as can be seen in the image, where the “Date”, “Location” and “Gender” are all aligned perfectly. But how would you align buttons towards the bottom in Call To Action-modules?
I’ve attached a photo that hopefully will explain what I mean. But I have a row of Call To Action-modules (the ones with pictures of individuals and buttons with their names); which will be constantly added to.
The above row is how it looks like in my website and the lower row is what I created with Paint:

Hi John,
The simple answer is to just not use the CTA module. I don’t know if I have ever used it, to be honest. In your case, the image is the background image of the CTA module, so you may as well make it the background image of the columns and then add text and button modules as needed and even adjust the min heights of the text above the buttons if you want them to go to the bottom.
What module would you recommend I use instead? And any easy to follow step-by-step guide for that, since I’m a novice (and don’t intend to have any text on the images, just buttons – and those buttons, when clicked on, would open up popups for each individual with more info and pictures)
I’m not sure what you are asking. I mentioned using text and image modules. Did you try that?
This is amazingly helpful, thank you, thank you!. Now I’ve just got to get my side by and nicely centred buttons (and only the buttons) to always be at the bottom of the column and lined up with each other across the page. I have text of different lengths above them (don’t we always!) I don’t suppose you can help me with that? I’ve been trying all sorts to but nothing has worked. If i try the position: absolute; / bottom: 0; it knocks everything out of whack. and flex puts them one on top of each other again. I’m… Read more »
Hi Kelly,
The easy and often overlooked solution to this is just to set min-heights for the text. Find the longest text, play around with the height, then apply that min-height to the other columns. Be sure to adjust for responsiveness.
Thanks for getting back to me. That of course worked like a dream. Why I dint think of that perfectly simple solution is beyond me. But like you say, sometimes you just overlook the simple solution. Thanks again for your help 🙂
Thank you so much! BIG HELP!
You’re welcome Tim! Glad this was helpful to you!
My Buttons are not lining up right 🙁
Do you have some spacing on the buttons in the module? And a link so I can check for sure…
thanks I was looking for this. I am new to Divi. could you also help me out with inline text module in the same column.
Hi Emma,
Sure, just add “display: inline-block; float: left;” to your text modules in the Advanced tab in the custom CSS main element.
Thank you for saving me 9 bucks.
You’re welcome! I’m not sure how I saved you $9 but I’m glad I did 🙂
Thx for help)
You’re welcome!
worked perfectly, thanks for the help
You’re welcome, glad to help!
.pa-inline-buttons {
text-align: center !important;
}
this worked but I want to center it only phone and tablet mode. How I can get it?
Hello, sure you just need to put your code in a media query to do that. You can reference our tutorial for that: https://www.peeayecreative.com/how-to-add-custom-css-media-queries-to-divi-for-making-your-site-responsive/
Hi Nelson, This looks simple, but I cannot seem to get it to work! I have placed the code in the correct places (have tried placing the CSS in Page, Divi Options and Child CSS Files) But the buttons will not go side by side, they just stay in their original (Default) positions I have also tried on blank page and the DIVI theme builder, but all have the same result…:( I have no other custom CSS applied to buttons or Plugins that might be interfering so I am now at a loss as to why? Unfortunately it is not… Read more »
The Christ,
It’s hard to tell without a link, but are you making sure the class is in the column rather than the button?
Absolutely 🙁 double checked your written and video instructions, it is an odd one. I Have implemented some of your other tips/trick without issue in the past!
Getting Closer, just not inline
I’ll see if i can get a link organised..
Here is the link…
http://stage.conneqtit.com.au/contact/
Hi Chris,
I don’t see my code in the CSS. When I inspect the site, I can find the button and add display: inline-block; and it works, so I’m not sure what is wrong. Send an email if you want more help with that.
This worked great with buttons, how can i extend this behaviour to image modules? thanks in advance!
Hi Fabio, for any other module just add display: inline-block; in the advanced tab in the Main Element of the custom CSS.
Again, Great guide.
I was wondering if it would be possible to do the same thing but with image modules within a column instead?
Thanks !
Sure, you can place any items side by side by adding display: inline-block; float: left; to the main element.
Hi Nelson, thanks for the helpful tutorial. Is there a way to disable this for smartphone? I assume I have to add something to the snippet?
Regards, Wim
Hi Wim,
You can wrap your code in a media query to only affect Tablet and Desktop like 768px and up. https://www.peeayecreative.com/how-to-add-custom-css-media-queries-to-divi-for-making-your-site-responsive/
Hello! Does this only work in Divi? I tried using your method in another builder but it didn’t work 🙁
GoHighLevel is what I tried using it in, in case it matters 😀
Well, display: inline-block; certainly is universal and should work, but the rest of the code and tutorial is for Divi.
Hi, I’m able to get this to work on a row with a single column, but when it’s multiple columns it doesn’t seem to work for me. Any suggestion?
Hi Gal,
In my tutorial I am using two columns. Are you saying it doesn’t work if two columns are used?
That’s correct, but maybe I’m doing this wrong. On this page you can see the buttons are not side by side in the 2 column rows, but are behaving as expected on the bottom of the page: https://channelpro.pypestream.com/
Hi Gal,
I’m not sure what the issue is there, sorry!
Are you saying there is another underlying issue?
I’m not really sure, but I’m just assuming so since the tutorial works fine for me and others.