i have simple animation on div which change background-color on :hover, but, when mouse leave this div, the transition with initial color is not working
if someone has css or javascript solution it is welcome !
.arc_en_ciel{
width: 300px;
height: 300px;
background-color: rgb(64, 137, 126);
-webkit-transition: background-color 0.7s ease-in-out;
-moz-transition: background-color 0.7s ease-in-out;
-o-transition: background-color 0.7s ease-in-out;
transition: background-color 0.7s ease-in-out;
}
.arc_en_ciel:hover{
animation-name: animation;
animation-duration: 4s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-play-state: running;
}
@-webkit-keyframes animation{
0% {background-color: rgb(64, 137, 126);}
50% {background-color: #1f5e54;}
100% {background-color: rgb(64, 137, 126);}
}
@keyframes animation{
0% {background-color: rgb(64, 137, 126);}
50% {background-color: #1f5e54;}
100% {background-color: rgb(64, 137, 126);}
}
<div class="arc_en_ciel"></div>
animationis a reserved word in CSS, try renaming your animation something unique.