Home
CSS
CSS Animations
Tryit: Using the animation-fill-mode property
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> div { width: 100px; height: 100px; background: red; position: relative; animation-name: example; animation-duration: 3s; animation-delay: 2s; animation-fill-mode: backwards; } @keyframes example { from {top: 0px; background-color: yellow;} to {top: 200px;} } </style> </head> <body> <h1>CSS Animation</h1> <p>Let the div element get the style values set by the first keyframe before the animation starts (during the animation-delay period):</p> <div></div> </body> </html>