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

Define your own ajax function using JavaScript

Since the network requests initiated by native js...

HTML 5.1 learning: 14 new features and application examples

Preface As we all know, HTML5 belongs to the Worl...

Details of Linux file descriptors, file pointers, and inodes

Table of contents Linux--File descriptor, file po...

Vue implements internationalization of web page language switching

1. Basic steps 1: Install yarn add vue-i18n Creat...

What is the file mysql-bin.000001 in mysql? Can it be deleted?

After installing MySQL using ports, I found that ...

Discussion on the Issues of Image Button Submission and Form Repeated Submission

In many cases, in order to beautify the form, the ...

Detailed explanation of JavaScript prototype chain

Table of contents 1. Constructors and instances 2...

How to install Linux online software gcc online

Linux online installation related commands: yum i...

Setting up VMware vSphere in VMware Workstation (Graphic Tutorial)

VMware vSphere is the industry's leading and ...

Does Mysql ALTER TABLE lock the table when adding fields?

Table of contents Before MySQL 5.6 After MySQL 5....

Detailed explanation of common methods of JavaScript arrays

Table of contents Common array methods pop() unsh...

How to find and delete duplicate rows in MySQL

Table of contents 1. How to find duplicate rows 2...

Installation and configuration method of vue-route routing management

introduce Vue Router is the official routing mana...