Browse documentation
Reference / Transitions & animation
Animation fill mode
Choose whether the first keyframe applies during a delay and whether the last keyframe persists after the final iteration.
Working example
Place the caption
Both combines backwards and forwards. It keeps this caption at its incoming position during the delay, then at its final position after arrival.
<details class="group rounded border p-4">
<summary class="cursor-pointer font-semibold">Place the caption</summary>
<p class="mt-3 origin-left motion-safe:group-open:animate-slide-in-right motion-safe:group-open:animate-delay-150 motion-safe:group-open:animate-fill-both">Plate 02 · Relief print</p>
</details>Class reference
| Class | CSS declarations |
|---|---|
animate-fill-none | animation-fill-mode: none; |
animate-fill-backwards | animation-fill-mode: backwards; |
animate-fill-forwards | animation-fill-mode: forwards; |
animate-fill-both | animation-fill-mode: both; |
View full generated CSS
.animate-fill-backwards {
animation-fill-mode: backwards;
}
.animate-fill-both {
animation-fill-mode: both;
}
.animate-fill-forwards {
animation-fill-mode: forwards;
}
.animate-fill-none {
animation-fill-mode: none;
}