اجرا و درآخر ثابت
بازگشت به صفحه اصلی
بازگشت به صفحه مقاله
دو ستونی
دو سطری
اجرای کد RUN »
<!DOCTYPE html> <html> <head> <style> .div { width: 100px; height: 100px; background: red; position: relative; -webkit-animation-name: example; /* Safari 4.0 - 8.0 */ -webkit-animation-duration: 3s; /* Safari 4.0 - 8.0 */ -webkit-animation-delay: 2s; /* Safari 4.0 - 8.0 */ -webkit-animation-fill-mode: both; /* Safari 4.0 - 8.0 */ animation-name: example; animation-duration: 3s; animation-delay: 2s; animation-fill-mode: both; } /* Safari 4.0 - 8.0 */ @-webkit-keyframes example { from {top: 0px; background-color: yellow;} to {top: 200px; background-color: blue;} } @keyframes example { from {top: 0px; background-color: yellow;} to {top: 200px; background-color: blue;} } </style> </head> <body> <p>Let the div element get the style values set by the first keyframe before the animation starts, and retain the style values from the last keyframe when the animation ends:</p> <div class="div"></div> <p><strong>Note:</strong> The animation-fill-mode property is not supported in Internet Explorer 9 and earlier versions.</p> </body> </html>