Introduction to CSS Animations

Unlike transitions, animations don’t need user interaction — they can run automatically and repeat.

Basic syntax:

@keyframes example {
  from { background: red; }
  to { background: blue; }
}
.box {
  animation: example 2s infinite alternate;
}

Practice Task:
Create a box that keeps changing its background color from red to blue.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *