CSS animation-duration property

CSSWeb DevelopmentFront End Technology

Use the animation-duration property to set how long an animation should take to complete one cycle


You can try to run the following code to implement the animation-duration property −

Live Demo

<!DOCTYPE html>
         div {
            width: 150px;
            height: 200px;
            position: relative;
            background: red;
            animation-name: myanim;
            animation-duration: 2s;
         @keyframes myanim {
           from {left: 0px; background-color: green;}
            to {left: 200px; background-color: blue;}
Published on 16-May-2018 12:27:27