Hackforge Academy

Category: html_css

CSS animations

Published on 29 Jun 2026

Explanation

CSS animations create more advanced effects by defining keyframes that describe how an element changes over time.

Code:

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

Explanation

The animation property applies a keyframe animation to an element.

Code:

.box {
  animation: fade 2s;
}

Explanation

Animations can repeat continuously using the infinite keyword.

Code:

.loader {
  animation: spin 1s linear infinite;
}

Explanation

Multiple keyframes can define complex animations by specifying different stages.

Code:

@keyframes move {
  0% { left: 0; }
  50% { left: 100px; }
  100% { left: 0; }
}

Explanation

Animation properties include duration, delay, iteration-count, direction, and timing function.

Code:

.circle {
  animation: bounce 2s ease-in-out infinite;
}

๐Ÿš€ Learn Spring Boot with real-world projects

๐Ÿ’ก Build REST APIs step by step

๐Ÿง  Improve backend development skills

๐ŸŽฏ Get career-ready practical training

Join Our Free WhatsApp Community

Direct access to niche-specific mentors and peers on WhatsApp.

๐Ÿ

Python Community

Discuss Django, FastAPI, AI integration, and automation scripts with 15k+ developers.

Join Python Community
โš›๏ธ

React Community

Master Next.js, Framer Motion, and State Management. Share your latest UI components.

Join React Community
โ˜•

Java Community

Deep dives into Spring Boot, Microservices architecture, and high-performance backend ops.

Join Java Community