CSS Animations

Understanding Keyframes

Keyframes define the start and end states of an animation, as well as any intermediate points. You use the @keyframes rule to create these keyframes.

  • Basic Usage

This example creates a fadeIn animation that transitions the element’s opacity from 0 to 1 over 2 seconds.

Tutorials dojo strip
CSS




Applying Animation Properties

You can control various aspects of the animation using properties like animation-durationanimation-timing-functionanimation-delay, and animation-iteration-count.

In this example, the .slide-in class applies a sliding animation that moves an element from off-screen to its original position. The animation lasts for 3 seconds, starts after a 1-second delay, and repeats infinitely.

CSS




CSS Animations Example Code

CSS




CSS Labs

Tutorials dojo strip