I can't figure out how to change the button color upon hover on my WordPress site. I've looked up so many tutorials and articles that are telling me to paste this code and change the color and just find the class name of your button by inspecting and neither work. I try and inspect the website but can't find the class of the button anywhere.
Please help me, it's so stupid that WordPress doesn't have the feature built in to just simply change the color upon hover when they already have the function for links.
This code did work for outlined buttons, but changed the outline color of the button when I wanted it to keep the same one:
.wp-block-button.is-style-outline .wp-block-button__link:hover {
background: #eb3434 !important;
/* Hover background color */
border-color: #ff0000 !important;
/* Hover border color */
}
That outline color change sounds like the border-color you selected, keep it with the background-color property to the desired hover color
Share your website url and tell which button you want to change the color.
When CSS is not working as expected, there are only two possibilities:
1. wrong selectors – the declaration will not appear at all in the Inspector – you need to fix the selectors
2. the specificity is beaten by another declaration – your declaration appears in the Inspector for your element, but with a strikethrough. It means the selector is correct, but you need to increase specificity.