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;

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.

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 *.

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

Latest Posts

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...

Disable Slide-In Animation for Divi Gallery Grid Images

Control how images appear in your Divi Gallery module by toggling the slide-in animation effect for grid layouts. Disabling the slide-in animation allows gallery images to load instantly and appear statically, providing a faster and distraction-free browsing...

Control Image Count Display in Divi Gallery Lightbox

Displaying or hiding the image count in the Divi Gallery module’s lightbox can help customize the user experience, depending on whether you want to give visitors an indication of gallery progress or prefer a cleaner, distraction-free view. The ability to toggle this...

Hide Gallery Image Titles in the Divi Lightbox Overlay

Displaying image titles in the lightbox overlay of the Divi Gallery module can sometimes be distracting or unnecessary, depending on your website’s design and user experience goals. Hiding these titles creates a cleaner and more focused viewing experience for visitors...

Random Posts