CSS Properties: How to specify the duration of an animation takes to complete?
Solution:
HTML Code:
Explanation:
- The HTML document contains a container div with a class of "animation" and a child div with a class of "w3r" for text content.
- CSS is used to style the elements, setting their colors, sizes, and positioning.
- Animation is applied to the div elements using keyframes (@keyframes mymove) to define the animation behavior.
- The animation-duration property is used to specify the duration of the animation. The value "alternate" makes the animation reverse direction on every cycle, "reverse" makes the animation play in reverse, and "normal" makes it play in the default direction.
Live Demo:
See the solution in the browser
Supported browser
![]() |
![]() |
![]() |
![]() |
![]() |
Yes | Yes | Yes | Yes | No |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics