This content originally appeared on DEV Community and was authored by DEV Community
Problem Statement
I want the animation to run for 4 seconds.
~ plus ~
I want the animation to delay for 6 seconds in between iterations.
~ equals ~
10 total seconds
Here is how you achieve it.
.swing {
animation: swing ease-in-out 5s infinite alternate;
transform-origin: center -20px;
animation-delay: 0s;
}
@keyframes swing {
0% {
transform: rotate(3deg);
}
30% {
transform: rotate(-3deg);
}
40% {
transform: rotate(0deg);
}
}
Demo:
You may change the animation and delay as per you need.
👋
This content originally appeared on DEV Community and was authored by DEV Community

DEV Community | Sciencx (2022-03-16T08:47:26+00:00) How to add delay between CSS keyframe animation ⚓. Retrieved from https://www.scien.cx/2022/03/16/how-to-add-delay-between-css-keyframe-animation-%e2%9a%93/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.