Awesome CSS Animation

Learn how to create Color, Shape, and Position changing Animation using only HTML and CSS.

Watch the animation tutorial video here-



The VS Code extensions used in this video are Live Server, Bracket Pair Colorizer, and Prettier.


HTML Source Code-

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>
<body>
    <div class="box"></div>
</body>
</html>

Download HTML source file

CSS Source Code-

body{
    background-color#333;
}
.box{
    height150px;
    width150px;
    positionrelative;
    animation-name: shifting;
    animation-duration4s;
    animation-iteration-countinfinite;
}
@keyframes shifting{
    0%{background-color:redleft:25vwtop:25vhborder-radius:0;}
    25%{background-color:orangeleft:60vwtop:25vhborder-radius:50%;}
    50%{background-color:yellowleft:60vwtop:60vhborder-radius0;}
    75%{background-color:greenleft:25vwtop:60vhborder-radius50%;}
    100%{background-color:redleft:25vwtop:25vhborder-radius:0;}
}

Download CSS source file

Post a Comment

0 Comments