Class to a buton

Hello,
I’ve read on another post how to add a class to a image but i dunno why it doesn’t work. I want to make a image button with another image when hovered.

In pro/theme options/css i got this class to have a hover image appearing when the button is hovered

.bouton-actu:hover {
background: url('https://ensemblesauvonslaphp.fr/wp-content/uploads/2019/05/bouton_actu_dessus.png');

In the page i created a image element and in it’s customize/class i put : bouton-actu
And it’s not working, what’s wrong ?

Hi There @Lyser

Thanks for writing in! You have actually added an image, not a button. Instead of that approach, I have added a button next to it, assign the class my-button into it and used the following CSS to demonstrate how it should be done.

.my-button {
    background-image: url(https://ensemblesauvonslaphp.fr/wp-content/uploads/2019/05/bouton_actu.png);
    width: 154px;
    height: 47px;
}
.my-button:hover {
    background-image: url(https://ensemblesauvonslaphp.fr/wp-content/uploads/2019/05/bouton_actu_dessus.png);
}

You can check that example and implement accordingly.

Thanks!

Ok i see, thank you for helping mldarshana ! =)

On behalf of my colleague, you’re welcome. Cheers! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.