Hover Background image - Forum

Forum Navigation
You need to log in to create posts and topics.

Hover Background image

Hi Luis, I have this button image ( I built) and I want to use the same image button with a different color for the Hover background image.  How do I do this, because in the Hover option, there is only variable?

Roger

Uploaded files:
  • You need to login to have access to uploads.

Hi @rocote,

I don't understand very much your question but the correct syntax for background-image is this:

url('./img/yourimage.jpg')

You can also use it for gradients using:

linear-gradient(red, yellow, green)

Where "./img/yourimage.jpg" is the path to the image. Take a look here for more information:
https://www.w3schools.com/cssref/pr_background-image.asp

Alright, I'm trying again.

1. I have an image (a) that I click on it and an action occurs.

2. When I hover my mouse over this image (a), I want another image (b) to appear. But the image (a) comes back when my mouse is not over (Hover).

I hope I have explained myself better.

Thanks Luis

Roger

@rocote, please take a look at the attached sample.
Look at the image mouse-enter and mouse-leave events.

Best regards.

Luis.

Uploaded files:
  • You need to login to have access to uploads.

Thank you!