0Pricing
CSS Academy · Lesson

Animation Direction Fill-Mode and Iteration

Control animation playback direction, how many times it loops, and the final state with fill-mode.

animation-iteration-count

Controls how many times the animation repeats. Use infinite for continuous looping.

.spinner {
  animation: rotate 1s linear infinite;
}

.pulse {
  animation: pulse 2s ease-in-out 3; /* plays 3 times */
}

animation-direction

Controls the playback direction on alternate cycles:

  • normal — plays forward each iteration
  • reverse — plays backward
  • alternate — forward then backward, alternating
  • alternate-reverse — backward then forward
.bounce {
  animation: bounce 1s ease-in-out alternate infinite;
}

All lessons in this course

  1. @keyframes Syntax and Animation Property
  2. Animation Direction Fill-Mode and Iteration
  3. Chaining and Sequencing Animations
  4. Accessible Animations with prefers-reduced-motion
← Back to CSS Academy