Is this correct? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Is this correct?

img{ filter:grayscale (100%); } img:hover{ filter: saturate(100%); transition: 1s; } But it doesn’t work as I want. I want that when mouse is over the image, it changes its saturation in a second transition. Help please!! Thanks in advance!

6th Aug 2020, 3:53 PM
Tomás Atrat
12 Answers
+ 5
You should add at img transition:filter 1s;
6th Aug 2020, 3:55 PM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
+ 4
Don’t worry I have just solved it, the problem was that i write saturate (100%) and I had to write grayscale(0%) then it worked!!
6th Aug 2020, 4:39 PM
Tomás Atrat
+ 3
Sorry but why u ise saturate, use the same grayscale but with less prpcentage for example 0%.
6th Aug 2020, 5:09 PM
george
george - avatar
+ 3
george that is what I wrote 🙂
6th Aug 2020, 6:06 PM
Tomás Atrat
+ 3
Tomás Atrat yes i found your answer after writing my, it is difficult to read posts via phone)
6th Aug 2020, 6:08 PM
george
george - avatar
+ 3
Master Genius I tried that before I could solve it, but the transition happens when the page loads, not when the mouse is over... thank you!!
7th Aug 2020, 1:54 PM
Tomás Atrat
+ 2
I don't get what does second transition means
6th Aug 2020, 3:55 PM
Abhay
Abhay - avatar
+ 2
george do not worry at all!
6th Aug 2020, 7:00 PM
Tomás Atrat
+ 2
Your transition 1s; property should be in img{}
7th Aug 2020, 7:11 AM
Master Genius [ INACTIVE ]
Master Genius [ INACTIVE ] - avatar
+ 1
Abhay sorry i didn’t explain it well, I mean a the duration of the transition (1s)
6th Aug 2020, 4:13 PM
Tomás Atrat
+ 1
💜 Alex Tușinean 🍇 I have already tried it but it doesn’t work 😕
6th Aug 2020, 4:14 PM
Tomás Atrat
+ 1
Tomás Atrat use grayscale(0%)
6th Aug 2020, 4:38 PM
Abhay
Abhay - avatar