Shake Vertical is a continuous & looping CSS keyframe animation with 3 keyframe steps (0%, 100% → 10%, 30%, 50%, 70%, 90% → 20%, 40%, 60%, 80%). It animates transform (translateY).
Continuous and looping animations repeat without stopping. Blink, bounce, jello, pulse, shake, vibrate and wobble are used for attention cues, error states, notifications and idle effects.
Animation shorthand
.element {
animation: shake-vertical 1s ease 0s infinite normal forwards;
}@keyframes code
@keyframes shake-vertical {
0%, 100% { transform: translateY(0); }
10%, 30%, 50%, 70%, 90% { transform: translateY(-10px); }
20%, 40%, 60%, 80% { transform: translateY(10px); }
}HTML
<div class="element">Animated content</div>Keyframe steps
| Step | Styles |
|---|---|
| 0%, 100% | transform: translateY(0); |
| 10%, 30%, 50%, 70%, 90% | transform: translateY(-10px); |
| 20%, 40%, 60%, 80% | transform: translateY(10px); |
Respect reduced motion
@media (prefers-reduced-motion: reduce) {
.element {
animation: none;
}
}More Continuous & Looping animations
Frequently Asked Questions
Copy the @keyframes shake-vertical block and the animation shorthand into your stylesheet, then add the class to any element. The shorthand reads name, duration, timing function, delay, iteration count, direction and fill mode.
Yes. Change the second value in the shorthand, for example 2s for a slower animation, or use the settings above the code to try duration, timing, delay, repeat count, direction and fill mode and copy the updated CSS.
Replace infinite with a number such as 1 or 3 in the shorthand. The animation then plays that many times and stops.
Yes. It only animates transform and opacity, which browsers can hand to the GPU, so it stays smooth even on mobile devices.
