Why isn’t my CSS working

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

}

3 Comments
  1. That outline color change sounds like the border-color you selected, keep it with the background-color property to the desired hover color

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

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer