steps() CSS Function
The steps() easing function moves an animation in a fixed number of equal jumps instead of smoothly, useful for sprite animations.
Description
The steps() CSS function defines an easing function that moves in a fixed number of equal jumps instead of changing smoothly. The animation holds each value for a while and then jumps to the next, like the hand of a clock that ticks rather than sweeps. It is accepted by animation-timing-function, transition-timing-function and the related shorthands.
The first argument is the number of steps, a positive integer. The optional second argument, the jump term, decides when the jumps happen. jump-end (or end, the default) jumps at the end of each interval, so the final value is reached only when the animation finishes. jump-start (or start) jumps at the start of each interval. jump-none holds both the first and last values, and jump-both adds a jump at both ends. The keywords step-start and step-end are shorthands for steps(1, start) and steps(1, end).
/* Sprite sheet animation with 8 frames */
.sprite {
background: url("runner.png") 0 0;
animation: run 0.8s steps(8) infinite;
}
@keyframes run {
to { background-position: -800px 0; }
}
/* Typewriter effect: reveal one character at a time */
.typing {
width: 20ch;
overflow: hidden;
animation: type 2s steps(20, jump-none);
}
Interactive Demo
Syntax
steps() = steps( <integer>, <step-position>? )
<step-position> = jump-start | jump-end | jump-none | jump-both | start | end
Values
- <integer>The number of equal intervals (steps). Must be greater than 0, or greater than 1 with jump-none.
- jump-start | startThe first jump happens at the very start of the animation.
- jump-end | endThe last jump happens at the very end of the animation. This is the default.
- jump-noneNo jump at either end; the first and last values are each held for one interval.
- jump-bothJumps happen at both the start and the end, adding an extra step.
Example
Browser Support
The following information will show you the current browser support for the CSS steps() function. Hover over a browser icon to see the version that first introduced support for this CSS function.
Desktop





Tablets & Mobile





