এনিমেশন শেষ হলে এলিমেন্টটি শেষ কীফ্রেমের স্টাইল ধরে রাখতে চাইলে animation-fill-mode: forwards ব্যবহার করুন। এটি এনিমেশন সমাপ্তির পর এলিমেন্টকে আশ ফলাফলে রাখে।
উদাহরণ
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 150px;
height: 200px;
position: relative;
background: red;
animation-name: myanim;
animation-duration: 2s;
animation-fill-mode: forwards;
}
@keyframes myanim {
from { left: 0px; background-color: green; }
to { left: 200px; background-color: blue; }
}
</style>
</head>
<body>
<div></div>
</body>
</html>
টিপ: forwards ছাড়া backwards, both, none মানও ব্যবহার করা যায়।