bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Learn/CSS/Advanced Styling
CSS•Advanced Styling

CSS Transition Timing

CSS Transition Speed Curve

The transition-timing-function property specifies the speed curve of the transition effect.

This property can have one of the following values:

  • ease - transition will start slow, then go fast, and end slow (this is default)
  • linear - transition will keep the same speed from start to end
  • ease-in - transition will start slow
  • ease-out - transition will end slow
  • ease-in-out - transition will have a slow start and end
  • cubic-bezier(n,n,n,n) - lets you define your own values in a cubic-bezier function

The following example shows some of the different speed curves that can be used:

Example

Formatted code
#div1 {transition-timing-function: linear;}
#div2 {transition-timing-function: ease;}
#div3 {transition-timing-function: ease-in;}
#div4 {transition-timing-function: ease-out;}
#div5 {transition-timing-function: ease-in-out;}

Live preview

CSS Transition Delay

The transition-delay property specifies a delay before the transition starts.

The transition-delay value is defined in seconds (s) or milliseconds (ms).

The following example has a 1 second delay before starting:

Example

Formatted code
div {
  transition-delay: 1s;
}

Live preview

Transition + Transform

The following example combines transition and transform for a <div>:

Example

Formatted code
div {
  transition: width 2s, height 2s, background-color 2s, transform 2s;
}

Live preview

The following example combines transition and transform for a button:

Example

Formatted code
button {
  transition: background-color 1s ease-out, transform 1s
  ease-out;
}

Live preview

CSS Transition Properties

The following table lists all the CSS transition properties:

PropertyDescription
transitionA shorthand property for setting the four transition properties into a single property
transition-delaySpecifies a delay (in seconds) for the transition effect
transition-durationSpecifies how many seconds or milliseconds a transition effect takes to complete
transition-propertySpecifies the name of the CSS property the transition effect is for
transition-timing-functionSpecifies the speed curve of the transition effect

Previous

CSS Transitions

Next

CSS Animations

This chapter

Overview
53

Lessons

154m

Read time

1. CSS Rounded Corners2. Sass Tutorial3. CSS Border Images4. CSS Multiple Backgrounds5. CSS Background Size6. CSS Background Origin7. CSS Background Clip8. CSS Colors9. CSS Color Keywords10. CSS Gradients11. CSS Radial Gradients12. CSS Conic Gradients13. CSS Shadow Effects14. CSS Box Shadow15. CSS Text Effects16. CSS Custom Fonts17. CSS 2D Transforms18. CSS 2D Transform Scale19. CSS 2D Transform Skew / Matrix20. CSS 3D Transforms21. CSS Transitions22. CSS Transition Timing23. CSS Animations24. CSS Animation Timing25. CSS Animation Properties26. CSS Tooltip27. CSS Tooltip Arrows28. CSS Styling Images29. CSS Image Effects30. CSS Image Hover Overlays31. CSS Responsive Modal Images32. CSS Centering Images33. CSS Image Filter Effects34. CSS Image Shapes35. CSS object-fit Property36. CSS object-position Property37. CSS Masking38. CSS Gradient Mask Layers39. CSS SVG Mask Layers40. CSS Styling Buttons41. CSS Button Hover Effects42. CSS Button Groups43. CSS Pagination Styles44. CSS Multiple Columns45. CSS Column Rules46. CSS User Interface47. CSS Variables - var() Function48. CSS Overriding Variables49. CSS Variables and JavaScript50. CSS Variables in Media Queries51. CSS @property Rule52. CSS Box Sizing53. CSS Media Queries

On this page

CSS Transition Speed CurveCSS Transition DelayTransition + TransformCSS Transition Properties