CSS Animation Builder
Build keyframe animations with per-stop controls. Preview live and copy the generated CSS.
Playing…
@keyframes myAnimation { 0% { opacity: 0; transform: translateX(0px) translateY(20px) scale(0.95) rotate(0deg); } 25% { opacity: 0.5; transform: translateX(0px) translateY(10px) scale(0.97) rotate(0deg); } 50% { opacity: 1; transform: translateX(0px) translateY(0px) scale(1) rotate(0deg); } 75% { opacity: 1; transform: translateX(0px) translateY(0px) scale(1) rotate(0deg); } 100% { opacity: 1; transform: translateX(0px) translateY(0px) scale(1) rotate(0deg); } } .element { animation: myAnimation 1s ease 0s 1 normal forwards; }
Frequently Asked Questions
What is a CSS keyframe animation?
A CSS keyframe animation defines intermediate steps in a transition using @keyframes rules. You specify property values at different percentage points (0%, 50%, 100%), and the browser interpolates between them. This gives you full control over timing, easing, and multi-step sequences without JavaScript.
What is the difference between CSS transitions and animations?
Transitions animate a property change triggered by a state change (e.g. :hover). Animations run independently via @keyframes and can loop, reverse, and have multiple steps. Tip: use transitions for simple hover/focus effects and animations for looping sequences, loading spinners, or attention-grabbing UI elements.
How do I make CSS animations perform well?
Stick to animating transform and opacity — these properties are GPU-accelerated and don't trigger layout recalculations. Avoid animating width, height, top, left, margin, or padding as they cause expensive reflows. Tip: use will-change: transform on animated elements to hint the browser to optimize them.
How do I use a CSS animation with Tailwind CSS?
Tailwind provides animate-spin, animate-ping, animate-pulse, and animate-bounce out of the box. For custom animations, define @keyframes in your CSS file and add the animation to tailwind.config under theme.extend.animation and theme.extend.keyframes. This generator outputs both the raw CSS and Framer Motion code.
Can I combine multiple CSS animations on one element?
Yes, list them comma-separated: animation: fadeIn 0.3s ease, slideUp 0.5s ease-out. Each animation runs independently with its own duration and timing. Tip: use animation-delay on subsequent animations to create staggered sequences.