CSS 3: Animate or transition from one css value to another

To transition from one css value to another, you can use the transition attribute.

In your element, set the value you want to transition, with the time taken to do such: transition: flex-basis 0.3s; for example.

And the change flex-basis value somehow to see the transition, usually by changing either class or style property of an element.

You can change the type of transition by setting the transition-timing-function attribute: to ease-in-out for example.

css

Edit on github
comments powered by Disqus
Click me