Utilizor
Contact Us

CSS Animations

CSS allows animation of HTML elements without using JavaScript or Flash!

CSS Animations

CSS allows animation of HTML elements without using JavaScript or Flash!

@keyframes Rule

When you specify CSS styles inside the @keyframes rule, the animation will gradually change from the current style to the new style at certain times.

To get an animation to work, you must bind the animation to an element.

Example

Animation Duration

The animation-duration property defines how long an animation should take to complete. If the animation-duration property is not specified, no animation will occur, because the default value is 0s.

Example

@keyframes example {
  from {background-color: red;}
  to {background-color: yellow;}
}

div {
  width: 100px;
  height: 100px;
  background-color: red;
  animation-name: example;
  animation-duration: 4s;
}