Button Block CSS help
-
This has frustrated me for far too long. Seeking help here. WP 6+ using 2024 theme and Blocks. The “make a big red button in the header” request came in, while all other buttons on the site are a different style. So I add “additional css classes” to the button called header-button and add the following to customize.php
/* Header Button */
.header-button {
background-color: #d25175 !important;
color: #ffffff !important;
border-color: #d25175 !important;
}This accomplishes the task…almost. The button is indeed that pink/red color but there is the original brown one px boarder around it.
Designer says boarder must go when button is colored. I can’t, for the life of me, get that board to be pink/red.
I’ve tried all sorts of things with
.is-style-outline.is-style-outline.wp-block-button .wp-block-button__link {
border-color: #d25175 !important;
}Everything I try to that end, generally either change the entire site default button boarder to pink or does nothing at all.
The header button also has the class is-style-outline in the Advance/Additional CSS field, although I don’t recall putting that there, I guess I must have at some point.
Full disclosure, I’ve changed the hover style for the default button site wide, which works as expected, even overwriting the original boarder with the hover color on all buttons, even the header button. It’s the non-hover state of the header button that is giving me issues. I want that boarder the same color as the button, I guess./* Button hover */
.wp-block-button__link:hover {
background-color: #37808b !important;
color: #f1eeea; !important;
border-color: #37808b !important;
}Thank you,
Eric
The topic ‘Button Block CSS help’ is closed to new replies.