CSS to achieve the effect of rotating flip card animation

CSS to achieve the effect of rotating flip card animation

The css animation of the rotating flip effect, the specific content is as follows:

1. We first set the size, color, etc. of the two boxes, then position them to overlap, and finally set the animation

Here are some examples:

<style>
        .box {
            height: 300px;
            width: 300px;
            position: relative;
        }
        
        .zh,
        .fan {
            height: 300px;
            width: 300px;
            line-height: 300px;
            font-size: 30px;
            text-align: center;
            color: blue;
            transition: all 2s;
            backface-visibility: hidden;
            /* Back side is not visible */
            position: absolute;
            top: 0;
            left: 0;
        }
        
        .zh {
            background-color: aqua;
        }
        
        .fan {
            background-color: aquamarine;
            transform: rotateY(-180deg) rotateZ(-180deg);
        }
        
        .box:hover .zh {
            transform: rotateY(180deg) rotateZ(180deg)
        }
        
        .box:hover .fan {
            transform: rotateY(0) rotateZ(0);
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="zh">Front</div>
        <div class="fan">Back</div>

    </div>
</body>

2. The effects are as follows:

Summarize

The above is the CSS implementation of the rotating flip animation effect introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

<<:  HTML tag full name and function introduction

>>:  Six-step example code for JDBC connection (connecting to MySQL)

Recommend

Analysis of Hyper-V installation CentOS 8 problem

CentOS 8 has been released for a long time. As so...

Implementing simple tabs with js

Tab selection cards are used very frequently on r...

In-depth understanding of javascript class array

js array is probably familiar to everyone, becaus...

Detailed Analysis of or, in, union and Index Optimization in MySQL

This article originated from the homework assignm...

What qualities should a good advertisement have?

Some people say that doing advertising is like bei...

Example of using mycat to implement MySQL database read-write separation

What is MyCAT A completely open source large data...

How to install Docker on Raspberry Pi

Because the Raspberry Pi is based on ARM architec...

CSS implements the web component function of sliding the message panel

Hello everyone, I wonder if you have the same con...

Detailed explanation of JavaScript progress management

Table of contents Preface question principle test...

MySQL prepare principle detailed explanation

Benefits of Prepare The reason why Prepare SQL is...

MySQL sql_mode analysis and setting explanation

When inserting a set of data into the MySQL datab...

Explore the truth behind the reload process in Nginx

Today's article mainly introduces the reload ...

CentOS7 64-bit installation mysql graphic tutorial

Prerequisites for installing MySQL: Install CentO...