The cubic-bezier()
functional notation defines a cubic Bézier curve. The easing functions in the cubic-bezier subset of easing functions are often called "smooth" easing functions because they can be used to smooth down the start and end of the interpolation. They correlate an input progress to an output progress, both expressed as <number>
s. For these values, 0.0
represents the initial state, and 1.0
represents the final state.

A cubic Bézier curve is defined by four points: P0, P1, P2, and P3. The points P0 and P3 represent the start and the end of the curve. In CSS, these points are fixed as the coordinates progress (the abscissa the input progress, the ordinate the output progress). P0 is (0, 0)
and represents the initial progress and the initial state. P3 is (1, 1)
and represents the final progress and the final state.
Not all cubic Bézier curves are suitable as easing functions because not all are mathematical functions; i.e., curves that for a given abscissa have zero or one value. With P0 and P3 fixed as defined by CSS, a cubic Bézier curve is a function, and is therefore valid, if and only if the abscissas of P1 and P2 are both in the [0, 1]
range.
Cubic Bézier curves with the P1 or P2 ordinate outside the [0, 1]
range can cause the value to go farther than the final state and then return. In animations, for some properties, such as left
or right
, this creates a kind of "bouncing" effect.

However, certain properties will restrict the output if it goes outside an allowable range. For example, a color component greater than 255
or smaller than 0
in rgb()
will be clipped to the closest allowed value (255
and 0
, respectively). Some cubic-bezier()
values exhibit this property.
When you specify an invalid cubic Bézier curve, CSS ignores the whole property.
Each of the keywords ease
, ease-in
, ease-out
, and ease-in-out
is equivalent to a specific cubic-bezier()
value.