How to use css3 to achieve 3D flop effect (complete code attached)
Recently, I have been learning about CSS3, and I really feel that this is a very practical and cool technology. It can not only replace the patterns and shapes expressed in previous pictures, but also create some special effects. For example, shadow effects, gradient effects, etc., among which the 3D conversion effect is particularly cool. The content of this article is about how to use css3 to achieve 3D card flip effect. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
The principle of using css3 to achieve 3D flip effect
The so-called flip effect is to flip the image along the y-axis. Effect.
First of all, we need to be clear that there are two divs of the same size originally set, not just one! Then we need to overlap the two divs and use the position:absolute statement to overlap the divs placed above and below.
Next we need to rotate the first div along the y-axis. Here we will use the transform:rotageY (-180deg) statement to achieve this. At the same time, we need to distinguish between the two divs and rotate one of them. At the same time as 180deg, the other one rotates 0deg.
Finally, when the div rotated 180deg completes the rotation, we hide it and use the backface-visibility: hidden; statement to realize the function of the image disappearing when it is moved to an invisible place on the display.
ps: If anyone is unclear about the above content, you can check the relevant articles on this site.
How to use css3 to create a circular rotation animation (complete code attached)
Code for using css3 to achieve a 3D flip effect
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>PHP中文网</title> <script src="http://7xiyzi.com2.z0.glb.qiniucdn.com/20160409_weixinjquery-2.1.0.min.js?i=6" type="text/javascript" charset="utf-8"></script> </head> <body> <div class="div1"> <div class="div2"> <img src="/static/imghw/default1.png" data-src="http://static.wesai.com/files/upload/9/bd9/feeae/9bd9dfeeaee3b9be37a3ad4e75fe7004.jpg" class="lazy" alt="How to use css3 to achieve 3D flop effect (complete code attached)" > </div> </div> </body> </html> <style> .div1 { width: 185px; height: 251px; -webkit-transform-style: preserve-3d; -ms-transform-style: preserve-3d; -o-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-transition: all 400ms linear; transition: all 400ms linear; } .div1.div2 { -webkit-transform: rotateY(180deg); -ms-transform: rotateY(180deg); transform: rotateY(180deg); backface-visibility:hidden; } img { width: 185px; height: 251px; } </style> <script type="text/javascript"> $('.div1').click(() => { $('.div1').addClass('div2') }) </script>
The effect is as shown in the picture
##
The above is the detailed content of How to use css3 to achieve 3D flop effect (complete code attached). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



How to achieve wave effect with pure CSS3? This article will introduce to you how to use SVG and CSS animation to create wave effects. I hope it will be helpful to you!

This article will show you how to use CSS to easily realize various weird-shaped buttons that appear frequently. I hope it will be helpful to you!

Two methods: 1. Using the display attribute, just add the "display:none;" style to the element. 2. Use the position and top attributes to set the absolute positioning of the element to hide the element. Just add the "position:absolute;top:-9999px;" style to the element.

In CSS, you can use the border-image attribute to achieve a lace border. The border-image attribute can use images to create borders, that is, add a background image to the border. You only need to specify the background image as a lace style; the syntax "border-image: url (image path) offsets the image border width inward. Whether outset is repeated;".

How to create text carousel and image carousel? The first thing everyone thinks of is whether to use js. In fact, text carousel and image carousel can also be realized using pure CSS. Let’s take a look at the implementation method. I hope it will be helpful to everyone!

Implementation method: 1. Use the ":active" selector to select the state of the mouse click on the picture; 2. Use the transform attribute and scale() function to achieve the picture magnification effect, the syntax "img:active {transform: scale(x-axis magnification, y Axis magnification);}".

The animation effect in css3 has deformation; you can use "animation: animation attribute @keyframes ..{..{transform: transformation attribute}}" to achieve deformation animation effect. The animation attribute is used to set the animation style, and the transform attribute is used to set the deformation style. .

Adaptive layout, also known as "responsive layout", refers to a web page layout that can automatically recognize the screen width and make corresponding adjustments; such a web page can be compatible with multiple different terminals instead of making a specific version for each terminal. . Adaptive layout was born to solve the problem of mobile web browsing, and can provide a good user experience for users using different terminals.
