एनिमेशन गति प्रभाव बनाने और उपस्थिति बदलने की प्रक्रिया है। CSS विभिन्न एनिमेशन प्रभावों का समर्थन करता है जो इवेंट मोशन को बदलते हैं।
एनिमेशन के अंतर्गत, एक अवधारणा Keyframes का उपयोग किया जाता है। Keyframes CSS3 में मध्यवर्ती एनिमेशन चरणों को नियंत्रित करते हैं।
नीचे दिए गए उदाहरण में keyframes सिंटैक्स के साथ एनिमेशन की ऊंचाई, चौड़ाई, रंग, नाम और अवधि दिखाई गई है:
सिंटैक्स
@keyframes animation { from {background-color: pink;} to {background-color: green;} }
div { width: 100px; height: 100px; background-color: red; animation-name: animation; animation-duration: 5s; }