<style>
.tdb-block{
padding:5px 10px;
width:100px;
height:50px;
background-color:black;
animation:animation-name 1s;
}
/* animation @keyframe rule */
@keyframes animation-name {
from {margin-left: 0px}
to {margin-left: 250px;}
}
</style>
<div class="tdb-block">tdb-block</div>
<style>
/* animation @keyframe rule */
@keyframes example {
from {property: value}
to {property: value;}
}
</style>
<style>
/* multiple animation effects */
@keyframes animation-name {
0% {margin-left: 0px;}
20% {margin-left: 100px;}
30% {margin-left: 50px;}
50% {margin-left: 200px;}
80% {margin-left: 100px;}
100% {margin-left: 250px;}
}
</style>
<head>
<style>
.tdb-block{
padding:5px 10px;
width:100px;
height:50px;
background-color:black;
animation:animation-name 1s;
}
/* animation @keyframe rule */
@keyframes animation-name {
0% {margin-left: 0px;}
20% {margin-left: 100px;}
30% {margin-left: 50px;}
50% {margin-left: 200px;}
80% {margin-left: 100px;}
100% {margin-left: 250px;}
}
</style>
</head>
<body>
<div class="tdb-block">tdb-block</div>
</body>
<style>
/* animation delay*/
.tdb-animation{
animation-name: tdb-animation;
animation-duration: 4s;
animation-delay: 5s;
}
/*now the animation will start after 5 seconds */
</style>
<style>
/*animation-iteration-count*/
.tdb-animation{
animation-iteration-count: 5 /*or infinite*/;
}
/*the animation will run for 5 times */
</style>
<style>
/*animation timing function*/
.tdb-animation{
animation-timing-function: linear;
}
</style>
<!DOCTYPE html>
<html>
<head>
<style>
.tdb-block
{
padding:5px 10px;
width:100px;
height:50px;
background-color:black;
animation:animation-name 1s;
animation-delay: 1s;
animation-iteration-count: 5;
animation-timing-function: linear;
}
/* animation @keyframe rule */
@keyframes animation-name
{
0% {
margin-left: 0px;
}
20% {
margin-left: 100px;
}
30% {
margin-left: 50px;
}
50% {
margin-left: 200px;
}
80% {
margin-left: 100px;
}
100% {
margin-left: 250px;
}
}
</style>
</head>
<body>
<div class="tdb-block">tdb-block</div>
</body>
<html>
<style>
/* animation delay*/
.tdb-animation{
animation-name: tdb-animation;
animation-duration: 4s;
animation-direction: normal | reverse | alternate
| alternate-reverse;
}
</style>
<style>
/*animation-iteration-count*/
.tdb-animation{
animation-iteration-count: 5;
animation-fill-mode: backward;
}
</style>
<style>
/*animation timing function*/
.tdb-animation{
animation: tdb-animation 10s linear 5s 3 forward;
}
</style>
<!DOCTYPE html>
<html>
<head>
<style>
.tdb-block
{
padding:5px 10px;
width:100px;
height:50px;
background-color:black;
animation:animation-name 1s;
animation-direction: normal;
animation-fill-mode: backward;
animation-delay: 1s;
animation-iteration-count: 5;
animation-timing-function: linear;
animation-direction: normal;
animation-fill-mode: backward;
}
.animation{
animation: tdb-animation 5s linear;
padding:5px 10px;
width:100px;
height:50px;
background-color:orange;
}
@keyframes tdb-animation
{
0% {
margin-left: 0px;}
100% {
margin-left: 250px;}
}
@keyframes animation-name
{
0% {
margin-left: 0px;}
100% {
margin-left: 250px;}
}
</style>
</head>
<body>
<div class="tdb-block">tdb-block</div></br>
<div class="animation">tdb-block</div>
</body>
<html>
Share TDB SCHOOL
Share this E-Learning Website on social media platforms with your friends and followers