<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>animation and keyframe</title>
</head>
<style>
.container{
background-color: blue;
width: 100vw;
height: 300px;
margin: 0px 0px;
}
.box{
border: 2px solid red;
background-color: green;
border-radius: 15px;
width: 200px;
height: 150px;
margin: 15px 5px;
position: relative;
/* animation-name: upendra1;
animation-duration: 3s;
animation-iteration-count: 2;
animation-direction: initial;
animation-fill-mode: alternate;
/* animation-timing-function: ease-out; */
animation-name: upendra2;
animation-duration: 10s;
animation-delay: 5s;
animation-iteration-count: 10;
}
@keyframes upendra2{
0%{
top: 0px;
left: 0px;
}
25%{
top:250px;
left: 0px
}
75%{
left: 250px;
top: 250px;
}
100%{
top: 0px;
left: 250px;
}
}
@keyframes upendra1{
from{
width: 200px;
}
to{
width: 800px;
}
}
</style>
<body>
<div class="container">
<div class="box">
</div>
</div>
</body>
</html>
No comments:
Post a Comment