animation-play-state: paused|running|initial|inherit;
Value | Description |
---|---|
paused | Specifies that the animation is paused |
running | Default value. Specifies that the animation is running |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Implement CSS code to paused animation play state.
<style> body { background: #cc99ff; } .div1{ width: 200px; height: 200px; background: green; position: relative; animation-name: mymove; animation-duration: 5s; animation-play-state: paused; } @keyframes mymove { from {left: 0px;} to {left: 200px;} } </style>
Complete Code For Using CSS Animation Play State Property With HTML
<!DOCTYPE html> <html> <head> <title>How To Use CSS Animation Play State Property With HTML</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/> </head> <style> body { background: #cc99ff; } .div1{ width: 200px; height: 200px; background: green; position: relative; animation-name: mymove; animation-duration: 5s; animation-play-state: paused; } @keyframes mymove { from {left: 0px;} to {left: 200px;} } </style> <body> <br/><br/> <div class="container"> <br> <div class="text-center"> <h1 id="color" style="color: white;"> CSS Animation Play State Property With HTML</h1> </div> <br> <div class="col-md-12"> <div class="div1"></div> </div> </div> </body> </html>