Home › Forums › CSS › Make CSS animations fade out when "un-hovered" › Reply To: Make CSS animations fade out when "un-hovered"
January 14, 2014 at 2:35 am
#160365
Participant
<div class="box"></div>
.box {
width: 100px;
height: 100px;
background: red;
position: relative;
left: 0;
}
.box:hover {
animation:anim 5s;
-webkit-animation:anim 5s;
animation-iteration-count:infinite;
}
@keyframes anim {
from { background:red;}
to {background:blue;}
}
@-webkit-keyframes anim {
from { background:red;}
to {background:blue;}
}