Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Make CSS animations fade out when "un-hovered" Reply To: Make CSS animations fade out when "un-hovered"

#160365
<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;}
}