Button Animations in CSS

From the CSS Animations cheat sheet · Practical Examples · verified Jul 2026

Button Animations

Interactive button effects for better user feedback

css
/* Ripple Effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transform: translate(-50%, -50%);
}

.ripple:active::before {
  animation: ripple 0.6s;
}

@keyframes ripple {
  to {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}
💡 Subtle animations improve UX
⚡ Transform scale for press effects
📌 Ripple effects for material design
✅ Disable animations for reduced motion preference

More CSS tasks

Back to the full CSS Animations cheat sheet