Skip to content
techsnow

Effects & Animation

Transitions

A transition animates a property smoothly when it changes, for example on hover.

Syntax:

transition: property duration timing-function delay;
.button {
  background: #1c6fa8;
  transition: background 0.2s ease, transform 0.2s ease;
}

.button:hover {
  background: #155a88;
  transform: translateY(-2px);
}
Timing functionFeels
easeNatural (default)
linearConstant speed
ease-inStarts slow
ease-outEnds slow, good for things appearing
ease-in-outSlow at both ends