Reputation: 1017
Goal is to keep the background red at the end of the animation.
Using chrome http://codepen.io/JulianNorton/pen/RNqLZM
.animation {
-webkit-animation:test-animation 2s 2;
// Animation stops after a few seconds, state doesn't stay red.
}
@-webkit-keyframes test-animation {
0% {
background-color:#fff
}
100% {
background-color:red
}
}
@keyframes test-animation {
0% {
background-color:#fff
}
100% {
background-color:red
}
}
Upvotes: 0
Views: 510
Reputation: 5482
animation-fill-mode: forwards;
is most likely what you were looking for. Source: CSS Animation property stays after animating
Upvotes: 1
Reputation: 159
Just set the background color of your .animation
element to red. Since the keyframe animation is triggered automatically, it will not appear red at first, but white like you want.
Upvotes: 0