The transition-timing-function property controls the speed curve of a transition — whether motion starts gently, ends softly, or moves at a constant rate.
01
Easing
Speed over time.
02
ease
Default curve.
03
linear
Constant speed.
04
ease-in/out
Entry & exit.
05
cubic-bezier
Custom curves.
06
steps
Stepped motion.
Fundamentals
Introduction
The transition-timing-function property in CSS defines how intermediate values for CSS properties being affected by a transition are calculated. This property allows you to control the speed of the transition, making it start slowly, speed up, or slow down at different points during the transition. It is essential for creating smooth and natural animations on your web pages.
Definition and Usage
Set transition-timing-function on the base element state alongside transition-property and transition-duration. The timing function applies to both the forward transition (e.g., hover in) and the reverse (hover out).
💡
Beginner Tip
ease-out feels natural for elements entering the screen; ease-in works well for elements leaving. ease-in-out is a safe default for color and size changes.
Foundation
📝 Syntax
The syntax for the transition-timing-function property is as follows:
Custom curves use cubic-bezier(x1, y1, x2, y2) with x values between 0 and 1.
Stepped motion uses steps(n, start|end).
Default is ease when omitted from shorthand.
The property is not inherited.
Related Properties
transition — shorthand including timing function
transition-duration — how long the transition runs
transition-property — which properties animate
animation-timing-function — easing for @keyframes animations
Defaults
🎯 Default Value
The default value of the transition-timing-function property is ease, which starts the transition slowly, speeds it up in the middle, and slows it down again before completion.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Default value
ease
Constant speed
transition-timing-function: linear;
Smooth in and out
transition-timing-function: ease-in-out;
UI enter effect
ease-out
Custom bounce
cubic-bezier(0.34, 1.56, 0.64, 1)
Inherited
No
Reference
💎 Property Values
The transition-timing-function property accepts keywords and function values.
Value
Example
Description
ease
ease
Starts slow, speeds up, then slows down (default).
linear
linear
Constant speed from start to finish.
ease-in
ease-in
Starts slow, then speeds up.
ease-out
ease-out
Starts fast, then slows down.
ease-in-out
ease-in-out
Starts slow, speeds up, then slows down.
cubic-bezier(n,n,n,n)
cubic-bezier(0.4, 0, 0.2, 1)
Defines a cubic Bezier curve. The x values range from 0 to 1.
steps(int,start/end)
steps(4, end)
Divides the transition into equal steps. The integer specifies the number of steps.
easelinearease-inease-outease-in-out
Context
When to Use transition-timing-function
Pick a timing function based on how the motion should feel:
General UI transitions — ease or ease-in-out for colors and subtle hover effects.
Elements appearing — ease-out for menus, tooltips, and panels sliding in.
Elements disappearing — ease-in for exits that accelerate away.
Mechanical motion — linear for progress bars and loaders.
Playful effects — Custom cubic-bezier with y values above 1 for slight bounce.
Preview
👀 Live Preview
Hover the box below — the color change uses ease-in-out over 1.2 seconds:
transition-timing-function: ease-in-out
Notice the gentle start and finish compared to linear.
Hands-On
Examples Gallery
In this example, we’ll change the background color of a div element with a smooth transition using the ease-in-out timing function.
📜 Core Patterns
Start with keyword timing functions, then compare how each curve feels.
Example 1 — ease-in-out color transition
In this example, we’ll change the background color of a div element with a smooth transition using the ease-in-out timing function.
A property value changes and the duration timer begins.
Trigger
3
Curve maps progress
The timing function controls how fast values change at each moment.
Easing
=
✅
Natural-feeling motion
The animation follows the chosen speed curve from start to finish.
Compatibility
Browser Compatibility
The transition-timing-function property is supported in all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. It is also supported in Internet Explorer 10 and later. As always, it is recommended to test your website across different browsers to ensure full compatibility.
✓ Modern browsers · Widely supported
Easing curves everywhere
Keywords, cubic-bezier(), and steps() work in current Chrome, Firefox, Safari, Edge, and Opera.
98%Browser support
Google Chrome26+ · Desktop & Mobile
Full support
Mozilla Firefox16+ · Desktop & Mobile
Full support
Apple Safari6.1+ · macOS & iOS
Full support
Microsoft Edge12+ · All versions
Full support
Opera12.1+ · All versions
Full support
Testing tip
Custom cubic-bezier curves render consistently in modern browsers. Test bounce effects on mobile to ensure they feel appropriate, not jarring.
transition-timing-function property98% supported
Bottom line:transition-timing-function is reliable for easing in all modern browsers.
Wrap Up
Conclusion
The transition-timing-function property is a vital tool for creating smooth and natural animations on your web pages.
By understanding and utilizing this property, you can enhance the user experience with subtle and effective transitions. Experiment with different timing functions to see how they can improve the look and feel of your web projects.