- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
CSS animation-fill-mode property
Use the animation-fill-mode property to set a style for the element when the animation is not playing.
You can try to run the following code to implement the animation-fill-mode property
Example
Live Demo
<!DOCTYPE html> <html> <head> <style> div { width: 150px; height: 200px; position: relative; background: red; animation-name: myanim; animation-duration: 2s; animation-fill-mode: backwards; } @keyframes myanim { from {left: 0px; background-color: green;} to {left: 200px; background-color: blue;} } </style> </head> <body> <div></div> </body> </html>
- Related Articles
- How to set the fill-mode for an Animation with CSS
- CSS animation-delay property
- CSS animation-duration property
- CSS Animation Shorthand property
- CSS animation-name property
- CSS animation-direction property
- CSS animation-iteration-count property
- CSS animation-play-state property
- CSS animation-timing-function property
- CSS top property with Animation
- CSS background-blend-mode Property
- CSS mix-blend-mode Property
- writing-mode Property in CSS
- Change CSS columns property with Animation
- Change CSS filter property with Animation

Advertisements