+ 9

How do I make background change smooth color change??

I want the background color to change smoothly not directly.....help me https://code.sololearn.com/WlJ0kxvfCL1e/?ref=app

27th Jun 2021, 11:34 AM
Anas Dharar
Anas Dharar - avatar
4 ответов
+ 5
Make use of keyframes. .info:hover{ animation:change 3s linear forwards; } @keyframes change{ from{background-color:aqua;} to{background-color:yellow;} };
27th Jun 2021, 11:47 AM
Abhay
Abhay - avatar
+ 4
Thanks Abhay
27th Jun 2021, 11:48 AM
Anas Dharar
Anas Dharar - avatar
+ 3
you could also limit transition to background or even background-color property (default apply to all animatable properties): transition: background 3s;
27th Jun 2021, 1:27 PM
visph
visph - avatar
+ 2
addd this .info:hover{ animation:change 1s linear forwards; transition:color 0.3s ease , background 0.8s ease; }
28th Jun 2021, 8:37 AM
blocked