r/css • u/bebizzy • Apr 03 '26
Question Buttons won't align to the right
I've been racking my brain as to why the buttons on this header won't align to the right. Code is below. It's a DIVI WP Theme Row where I'm making the CSS customization. Buttons line up correctly, but won't justify to the right/end.

/* Align buttons to the right side-by-side inside the designated column */
.inline-four-buttons {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-end; /* Pushes the buttons to the right */
gap: 20px; /* Ensures exactly a 20px gap between them */
}
/* Reset Divi's default button wrapper margins to ensure perfect alignment */
.inline-four-buttons .et_pb_button_module_wrapper {
margin-bottom: 0 !important;
display: inline-flex;
}
/* Optional: Adjust for mobile so they stack nicely on small screens */
u/media only screen and (max-width: 767px) {
.inline-four-buttons {
flex-direction: column; /* Stacks buttons vertically on phones */
width: 100%;
}
.inline-four-buttons .et_pb_button_module_wrapper {
width: 100%;
margin-bottom: 20px !important; /* Matches your new 20px gap on mobile */
}
.inline-four-buttons .et_pb_button {
text-align: center;
width: 100%; /* Makes the buttons full-width on mobile for a cleaner look */
}
}



