Flip In X Animation Effect with CSS

The CSS Flip In X animation effect creates a 3D flipping motion where an element rotates along the X-axis while appearing on the page. This animation starts with the element rotated 90 degrees and invisible, then flips into view with a bouncing effect.

Syntax

@keyframes flipInX {
    0% { transform: perspective(400px) rotateX(90deg); opacity: 0; }
    40% { transform: perspective(400px) rotateX(-10deg); }
    70% { transform: perspective(400px) rotateX(10deg); }
    100% { transform: perspective(400px) rotateX(0deg); opacity: 1; }
}

.flipInX {
    animation-name: flipInX;
    animation-duration: 1s;
}

Example

The following example demonstrates the Flip In X animation effect applied to a colored box −

<!DOCTYPE html>
<html>
<head>
<style>
    .animated {
        width: 200px;
        height: 100px;
        background-color: #3498db;
        margin: 50px auto;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: bold;
        animation-duration: 1s;
        animation-fill-mode: both;
    }
    
    @keyframes flipInX {
        0% {
            transform: perspective(400px) rotateX(90deg);
            opacity: 0;
        }
        40% {
            transform: perspective(400px) rotateX(-10deg);
        }
        70% {
            transform: perspective(400px) rotateX(10deg);
        }
        100% {
            transform: perspective(400px) rotateX(0deg);
            opacity: 1;
        }
    }
    
    .flipInX {
        backface-visibility: visible !important;
        animation-name: flipInX;
    }
</style>
</head>
<body>
    <div class="animated flipInX">Flip In X</div>
    <button onclick="location.reload();">Replay Animation</button>
</body>
</html>
A blue box with "Flip In X" text appears with a 3D flipping animation, starting from a 90-degree rotation and settling into place with a subtle bounce effect. The animation lasts 1 second.

Key Properties

Property Value Description
perspective() 400px Creates the 3D depth for the rotation effect
rotateX() 90deg to 0deg Rotates the element around the X-axis
backface-visibility visible Ensures the element remains visible during rotation
opacity 0 to 1 Controls the fade-in effect during animation

Conclusion

The Flip In X animation creates an engaging 3D entrance effect by combining rotation transforms with opacity changes. The bouncing motion at keyframes 40% and 70% adds a natural, dynamic feel to the animation.

Updated on: 2026-03-15T11:49:27+05:30

116 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements