I am able to make the image fade in but it immediately disappears when the cursor is off the image. I want it to slowly fade out. Here is an example of what I am wanting http://byvictoriageorge.studio/
Asked
Active
Viewed 24 times
2 Answers
0
Hard to say without code examples, but here is some theory.
You have a transition on your Image with opacity 0, and then it transitions to opacity 1 when hover.
You need to duplicate the same functionality, but vice versa. So what you can do it use the ease-in-out;
setting on the transision
css property.
So the full transition CSS would be soemthing like: transition: opacity 3s ease-in-out;
Edit: I can see your code transition: opacity .2s ease;
so you want to change this to:
transition: opacity .2s ease-in-out;
![](../../users/profiles/2551591.webp)
Sweet Chilly Philly
- 1,936
- 1
- 21
- 26
0
You need a little Javascript
- When the mouseenter add class (fade in)
- When the mouseleave add class (fade out)
or only CSS What is the opposite of :hover (on mouse leave)?
![](../../users/profiles/7258502.webp)
sakuragy
- 13
- 6