Animate CSS right property


To implement animation on right property with CSS, you can try to run the following code

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         #demo {
            position: absolute;
            right: 0;
            width: 300px;
            height: 200px;
            background-color: blue;
            animation: myanim 5s infinite;
         }
         @keyframes myanim {
            30% {
               right: 350px;
            }
         }
      </style>
   </head>
   <body>
      <h1>CSS right property</h1>
      <div id = "demo">
         <h1>This is demo text.</h1>
      </div>
   </body>
</html>

Updated on: 25-Jun-2020

208 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements