Change the height of a Divi Button module

Written by Dan Mossop

Divi buttons are a popular module used in Divi websites to create attractive calls to action. In some cases, you may want to adjust the height of the Divi button module to make it stand out more on your page. In this post, I will explain how to adjust the height of a Divi button.

Setting the Button Module (Minimum) Height

The Divi button module doesn't include an option to set its height, but you can do so by adding the following CSS code:

min-height: 100px;

Into the module's custom CSS option at:

Button Settings > Advanced > Custom CSS > Main Element

If you need to be able to apply the same height to multiple buttons, you can instead add the following CSS to your site:

.custom-height-buttons.et_pb_button {
	min-height: 100px;
}

And then add the following class:

custom-height-buttons

Your content goes here. Edit or remove this text inline or in the module Content settings. You can also style every aspect of this content in the module Design settings and even apply custom CSS to this text in the module Advanced settings.

Vertically Aligning the Button Module Text

If you've increased the min-height of your buttons, as above, then you'll find that the button text sits towards the top of the button area. If you'd like, instead, to vertically align this text in the center of the button, you can do so by adding the following CSS to your site: 

.vertically-aligned-button {
	display: inline-flex !important;
	align-items: center;
}
.vertically-aligned-button:after {
	right: 8px;
}

And then adding this class:

vertically-aligned-button

to any buttons you wish to vertically-align the text on. You can add the class at:

Button Settings > Advanced > CSS ID & Classes > CSS Class

And here's an example of the result:

Making the Button Wider / Centering the Text

If you use the above technique, then since we're converting the button into a "flex" element, the method of centering the button text horizontally changes. We can still use the "width" property to set the width of the button, but then need to use the "justify-content" property to center align the text. To so we can, for example, add the following CSS rules alongside the earlier ones:

width: 100%;
justify-content: center;

We may earn a commission when you visit links on our website.

Spruce Up Your Site with Divi Christmas Fonts!

Add a festive touch to your text buttons with Divi Christmas Fonts. Featuring 15 joyful fonts, seamlessly integrate them to make your holiday buttons stand out and capture the Christmas spirit. Perfect for adding that extra magic to your seasonal calls to action.

Latest Posts

Adjust Lightbox Arrow Size in Divi Gallery

Customize the size of the navigation arrows that appear in your gallery lightbox so they’re easier to see and aligned with your site’s design. Whether you want larger, more accessible controls or a subtler look, setting a precise arrow size creates a more polished...

Change Lightbox Arrow Color in the Divi Gallery Module

Make the lightbox navigation arrows in your Divi Gallery match your brand and stand out against your images by assigning a custom color. This improves visual consistency, enhances accessibility with better contrast, and elevates the overall browsing experience for...

Change the Divi Gallery Module Grid Image Scaling

Divi’s Gallery module offers a great way to showcase images, but it can sometimes stretch or crop them in unwanted ways. This article explains how to manage the module’s image scaling behavior to ensure your images are displayed at the correct size and aspect...

Set Custom CSS IDs for Individual Divi Accordion Items

Assigning unique CSS IDs to specific Divi Accordion items allows for precise control over styling, targeting, and linking within your page content. This ability is particularly useful when you want to apply custom designs or create anchor links to particular accordion...

Enable Swipe Navigation in the Divi Gallery Lightbox

Enabling swipe navigation in the Divi Gallery module's lightbox allows users to seamlessly browse through gallery images by swiping left or right, creating a more interactive and mobile-friendly experience. This functionality can significantly improve user engagement...

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

0 Comments

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

Your email address will not be published. Required fields are marked *.