Languages
[Edit]
EN

CSS - animation with transition property example

3 points
Created by:
Frida-Timms
667

Hello there! πŸ‘‹ 😊

In this article, I would like to show you how to use one of the coolest style property in CSS - transition. 😎⏭

Final effect:

CSS - transition property example (spinning square div)
CSS - transition property example (spinning square div)

Below example presents three CSS styles: 

  • .normal which is the default style of our div element,
  • .transformed which is transformed style of our div element,
  • .button which is style of our button element.

The styles of our div has transition value set to '1s'. It means our component will change it's property values smoothly, over a given duration (over 1s). Additional transform parameter describes moving of an element. In our case transform rotates the element during 2s.

Runnable example:

πŸ“ Note:
If the duration is not specified, the transition will have no effect, because the default value is 0.

Related posts

Edit
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

CSS - Blog posts

Native Advertising
πŸš€
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

β€οΈπŸ’» πŸ™‚

Join