<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
div{
width: 100px;
height: 100px;
line-height: 5;
text-align: center;
border: 1px solid #000;
background: #39ac39;
-webkit-animation: myAnimation 1s 1; /* Safari 4.0 - 8.0 */
animation: myAnimation 1s 1;
-webkit-animation-delay: 2s; /* Safari 4.0 - 8.0 */
animation-delay: 2s;
background: #39ac39;
}
#point{
-webkit-animation-fill-mode: none;
animation-fill-mode: none;
}
#point1{
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
#point2{
-webkit-animation-fill-mode: backwards;
animation-fill-mode: backwards;
}
#point3{
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes myAnimation {
from {border-radius: 0%; background: #f69d3c;}
to {border-radius: 50%; background: #0066ff}
}
@keyframes myAnimation {
from {border-radius: 0%; background: #f69d3c;}
to {border-radius: 50%; background: #0066ff}
}
</style>
</head>
<body>
<h1>CSS animation-fill-mode Property</h1>
<h2>animation-fill-mode: none;</h2>
<div id="point">
div
</div>
<h2>animation-fill-mode: forwards;</h2>
<div id="point1">
div
</div>
<h2>animation-fill-mode: backwards;</h2>
<div id="point2">
div
</div>
<h2>animation-fill-mode: both;</h2>
<div id="point3">
div
</div>
<p><strong>Note</strong>: Take a close look by clicking on the run button and check the following
<ul>
<li>none and backwards are a set</li>
<li>forward and both are other set</li>
<li>none will not apply any css property while animation is in delay. Whereas, backwards will apply.</li>
<li>forwards will not apply any css property while animation is in delay. Whereas, both will apply.</li>
</ul>
</p> </body>
</html>