This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The steps() CSS function defines a transition that divides the input time into a specified number of intervals that are equal in length. This subclass of step functions are sometimes also called staircase functions.
/* Different intervals */ steps(2, end) steps(4, jump-end) steps(12, end) /* Different jump positions */ steps(3, jump-start) steps(3, jump-end) steps(3, jump-none) steps(3, jump-both)
The function accepts the following parameters:
<integer>Represents the number of equidistant intervals or 'steps'. It must be a positive integer greater than 0 unless the second parameter is jump-none, in which case, it must be a positive integer greater than 1.
<step-position>Specifies when the jump between values occurs. If omitted, it defaults to end. The possible keyword values include:
jump-start or startIndicates that the first step happens when the animation begins.
jump-end or endIndicates that the last step happens when the animation ends.
jump-noneIndicates neither early nor late jumps happen.
jump-bothIndicates both early and late jumps happen.
The steps() function divides the animation duration into equal intervals. For example, steps(4, end) divides the animation into four equal intervals, with values changing at the end of each interval except the last change which occurs at the animation's end.
If an animation contains multiple segments, the specified number of steps applies to each segment. For example, if an animation has three segments and uses steps(2), there will be six steps in total, with two steps per segment.
The following image shows the affect of different <step-position> values when the jumps occur:
steps(2, jump-start) /* Or steps(2, start) */ steps(4, jump-end) /* Or steps(4, end) */ steps(5, jump-none) steps(3, jump-both)
<steps()> =
steps( <integer> , <step-position>? )
<step-position> =
jump-start |
jump-end |
jump-none |
jump-both |
start |
end
The following steps() functions are valid:
/* Five steps with jump at the end */ steps(5, end) /* Two steps with jump at the start */ steps(2, start) /* Using default second parameter */ steps(2)
The following steps() functions are invalid:
/* First parameter must be an <integer>, not a real value */ steps(2.0, jump-end) /* Number of steps must be positive */ steps(-3, start) /* Number of steps must be at least 1 */ steps(0, jump-none)
| Specification |
|---|
| CSS Easing Functions Level 1> # step-easing-functions> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
steps |
8 | 12 | 4 | 12.1 | 5.1 | 18 | 4 | 14 | 5 | 1.0 | 4 | 5 |
jump |
77 | 79 | 65 | 64 | 14 | 77 | 65 | 55 | 14 | 12.0 | 77 | 14 |
cubic-bezier() and linear()
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function/steps