What are CSS3 Animations?

  • An animation lets an element gradually change from one style to another.
  • You can change as many CSS properties you want, as many times you want.
  • To use CSS3 animation, you must first specify some @keyframes for the animation.
  • @Keyframes hold what styles the element will have at certain times.

The Building Blocks of Animations


CSS3 animations are made up of two basic building blocks.

  1. Keyframes - define the stages and styles of the animation.
  2. Animation Properties - assign the @keyframes to a specific CSS3 element and define how it is animated.
The @keyframes
  • Keyframes are the foundation of CSS animations.They define what the animation looks like at each stage of the animation timeline. 

Each @keyframes is composed of:

 1. Name of the animation:
A name that describes the animation, for example, bounceInRight.
   2. Stages of the animation:
Each stage of the animation is represented as a percentage. 0% represents the beginning state of the animation. 100% represents the ending state of the animation
   3. CSS Properties: 
 CSS properties defined for each stage of the animation timeline.

Animation Properties

Once the @keyframes are defined, the animation properties must be added in order for your animation to function
Animation properties do two things:

  • They assign the @keyframes to the elements that you want to animate.
  • They define how it is animated.

Comments

Popular posts from this blog

Bootstrap Breakpoints