Scale In Forward Horizontal-Center is a scale in forward CSS keyframe animation with 0 keyframe steps ().
Scale In Forward animations grow the element from a small size up to full size from a chosen origin. They are popular for modals, dropdowns, tooltips and image reveals.
Animation shorthand
.element {
animation: scale-in-forward-horizontal-center 1s ease 0s 1 normal forwards;
}@keyframes code
@keyframes scale-in-forward-horizontal-center {
}HTML
<div class="element">Animated content</div>Keyframe steps
| Step | Styles |
|---|
Respect reduced motion
@media (prefers-reduced-motion: reduce) {
.element {
animation: none;
}
}More Scale In Forward animations
Frequently Asked Questions
Copy the @keyframes scale-in-forward-horizontal-center block and the animation shorthand into your stylesheet, then add the class to any element. The shorthand reads name, duration, timing function, delay, iteration count, direction and fill mode.
Yes. Change the second value in the shorthand, for example 2s for a slower animation, or use the settings above the code to try duration, timing, delay, repeat count, direction and fill mode and copy the updated CSS.
Keep the iteration count at 1 and add the animation class to the element in your HTML. It plays once as soon as the element is rendered; use forwards or both to keep the end state.
Yes. It only animates transform and opacity, which browsers can hand to the GPU, so it stays smooth even on mobile devices.
