Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Keyframe Animations | CSS Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. CSS Course

Lesson 22 of 50

·css

Keyframe Animations

12 mins

Course progress44%

What you'll learn

Keep these ideas in mind as you work through the lesson.

2 points
  • `animation-fill-mode: forwards` keeps the element in its final keyframe state. * `animation-direction: alternate` makes the animation play forward then backward.
  • For performance, animate only `transform` and `opacity`.

Keyframe animations let you define a series of intermediate steps.

@keyframes slideIn {
  from { transform:translateX(-100%); opacity:0; }
  to   { transform:translateX(0);    opacity:1; }
}
.element { animation:slideIn 0.5s ease-out forwards; }

Animation properties:

  • animation-name, animation-duration, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, animation-fill-mode.

Example: Pulsing loader

@keyframes pulse {
  0%   { opacity:0.3; }
  50%  { opacity:1; }
  100% { opacity:0.3; }
}
.loader { animation:pulse 1.2s infinite; }
Make it stickPractice what you've learned1 quiz · 6 practical tests · Optional activities from CSS CourseBrowse activities
Previous lessonTransformsContinue to lesson 23Responsive Design – Media QueriesBack to CSS Course curriculum