YouTip LogoYouTip

CSS3 Transitions and Animations

Transitions

.button {
    background: blue;
    transition: background 0.3s ease;
}
.button:hover { background: red; }

Animations

@keyframes slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
.slide-in { animation: slide 0.5s ease-out; }

Summary

  • transitions animate between two states
  • @keyframes defines multi-step animations
← CSS3 Gradients and ShadowsCSS Flexbox Layout β†’