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

Hide the Page Title in the Hello Elementor Theme

Hiding the page title in the Hello Elementor theme allows you to create a cleaner and more customized page layout, free from default headings that may not fit your design. This is particularly useful for landing pages or custom content layouts where the default page...

How to Hide a Divi Module When Scrolling Up or Down

In this quick tutorial, I’ll show you how to hide a Divi module when scrolling in a specific direction (up or down), so that the module only shows when you want it to. This is especially useful when using Divi’s Scroll Effects feature and you have a effect you want to...

Fade a Divi Image Module Edge into the Background

Want to create a stylish fade effect on your Divi image module—where one side fades smoothly into the background? With a bit of CSS, you can make any edge (or corner) of the image fade out: top, bottom, left, right, or even diagonally.Fade a Divi Image Module Edge...

Hide the Header and Footer in the Hello Elementor Theme

Removing the default header and footer from your Hello Elementor theme allows for a streamlined and distraction-free website design. This is especially useful when creating unique landing pages, full-width layouts, or custom headers and footers with a page builder. In...

Setting up the Divi Password Box Module

Setting up password protection on a page can help you control access to sensitive or private content in WordPress, allowing only authorized visitors to view certain sections. With the Divi Password Box module, you can replace the plain Divi password form with a fully...

Random Posts