CSS Transitions

CSS transitions allows you to change property values smoothly (from one value to another), over a given duration.

How to Use CSS Transitions?

To create a transition effect, you must specify two things:
  • the CSS property you want to add an effect to
  • the duration of the effect
Example: Set this css width: 100px; height: 100px; background: red; -webkit-transition: width 2s; /* For Safari 3.1 to 6.0 */ transition: width 2s; On hover you just change width width: 300px;
Faisal Khan
Asked 14-06-2024
36

Submit your answer