Perform Animation on CSS margin-right property

CSSWeb DevelopmentFront End Technology

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

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            background-color: blue;
            animation: myanim 4s infinite;
            color: white;
         }
         @keyframes myanim {
            30% {
               margin-right: 30px;
            }
         }
      </style>
   </head>
   <body>
      <h2>Heading One</h2>
      <div>
         This is demo text.
      </div>
   </body>
</html>
raja
Published on 07-Jun-2018 16:25:12
Advertisements