To set name for animation to hold @keyframes rules.
<style> body { background: #ff944d; } .div1{ width: 200px; height: 200px; background: #9933ff; position: relative; animation-name: mymove; animation-duration: 5s; } @keyframes mymove { from {left: 0px;} to {left: 200px;} } </style>
Complete Code For Using CSS Animation Name Property With HTML.
<!DOCTYPE html> <html> <head> <title>How Do I Use CSS Animation Name 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: #ff944d; } .div1{ width: 200px; height: 200px; background: #9933ff; position: relative; animation-name: mymove; animation-duration: 5s; } @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: #802b00;">How Do I Use CSS Animation Name Property With HTML</h1> </div> <br> <div class="col-md-12"> <div class="div1"></div> </div> </div> </body> </html>