Arnie
Arnie

Reputation: 681

CSS :hover selector not working - why?

This is my CSS:

.add-to-cart button.button > span:hover {
    font-size: 14px;
}

It just wont work on hover. If I put the font-size: 14px; inside the selector without :hover, it works and the font size is changed, so why not on hover?

Unfortunately I can not share the markup, is a local installation only so far.

Thanks!

Upvotes: 1

Views: 2344

Answers (1)

Dario
Dario

Reputation: 280

you can try to add !important to your style in order to set the priority on the other style rules:

.add-to-cart button.button > span:hover {
    font-size: 14px !important;
}

If it doesn't work you probably should check your selector, in this case you can try to add the style to all the span tags (just to be sure that the selector is correct):

span:hover {
    font-size: 14px !important;
}

Upvotes: 4

Related Questions