Baidu Tieba's 3D card flop effect
This time I will bring you the 3D card flop effect of Baidu Tieba. What are the precautions to achieve the 3D card flop effect of Baidu Tieba. The following is a practical case, let’s take a look.
Today I will bring you a flip effect made by CSS3. When you move the mouse over an element, you can feel that you can see the information behind the element. If you make Lianliankan, poker-type games that test your memory, or even write some words to your girlfriend, you can try it after putting them in the photo album made using this example, ha~
Rendering:
Some new properties of CSS3 used in the example:
a, -webkit -perspective: 800px;
perspective (perspective, viewing angle): Property defines the distance of the 3D element from the view, in pixels. This property allows you to change the 3D element's view of the 3D element. Determines whether what you see is a 2D transform or a 3D transform.
b, -webkit-transform-style: preserve-3d;
The transform-style attribute specifies how nested elements are rendered in 3D space. The default is flat, we use 3D effect, and then select 3D.
c, -webkit-backface-visibility: hidden; Whether to display the selected element after it is rotated to the back.
d、-webkit-transform: rotateY(0); The element rotates around the Y axis.
The above attributes will give you a perceptual understanding first. After reading the examples, you can then taste these attributes carefully, or use Baidu or Google Shenma.
Example:
Html:
<body> <p id="content"> <ul> <li> <a href="#" target="_blank"> <p><img alt="" src="images/1.jpg"/></p> <p> <h3>漩涡鸣人</h3> <p>日本漫画家岸本齐史作品《火影忍者》中男主角。因为身上封印着邪恶的九尾妖狐,无父无母的他受尽了村人的冷眼与歧视,他下定决心要成为第六代火影,让所有人都认同他的存在。</p> </p> </a> </li> <li> <a href="#" target="_blank"> <p> <img alt="" src="images/2.jpg"/> </p> <p> <h3>日向雏田</h3> <p> 日本漫画家岸本齐史作品《火影忍者》中的3号女主角。木叶忍者村的女忍者,木叶名门日向一族宗家族长的长女。喜欢漩涡鸣人,原本是个性格柔弱的女孩,但是在鸣人的影响下逐渐变得坚强,并逐渐成长为一名优秀的忍者。</p> </p> </a> </li> <li> <a href="#" target="_blank"> <p><img alt="" src="images/3.jpg"/></p> <p> <h3>蒙奇·D·路飞</h3> <p>蒙奇·D·路飞 是日本人气动漫 《海贼王》中的主人公。是日本人气动漫 《海贼王》中的主人公。草帽海贼团船长,梦想是找到传说中的宝藏 —— ONE PIECE,成为海贼王。</p> </p> </a> </li> <li> <a href="#" target="_blank"> <p> <img alt="" src="images/4.jpg"/> </p> <p> <h3>盒子先生</h3> <p> Danbo是一只用废纸盒DIY出来的可爱玩偶,圆圆的眼睛和三角形的嘴巴,时刻露出无辜的表情,让人看到就心软,Danbo是个纯真善良的小家伙,在它单纯的幻想世界里,总是透露出最纯真可爱的动人气息。</p> </p> </a> </li> </ul> </p> </body>
is quite simple:
ul is a set of pictures, and there is a in each li (because we I hope you can jump by clicking on the picture), a contains two p's, one is when it is displayed normally (that is, the picture is displayed), and the other is when the picture is rotated (that is, the introduction).
CSS:
<link href="css/reset.css" rel="stylesheet" type="text/css"> <style type="text/css"> body { font-size: 14px; font-family: Microsoft YaHei, Tahoma, Geneva, sans-serif; background: #111; } #content ul { width: 960px; margin: 150px auto; padding: 60px 0; } #content ul li { margin-right: 20px; width: 225px; height: 180px; float: left; } #content ul li:last-child { margin-right: 0; } #content ul li a { position: relative; display: block; width: 100%; height: 100%; /*舞台(动画元素的父容器)perspective*/ -webkit-perspective: 800px; -moz-perspective: 800px; } #content ul li a > p { position: absolute; left: 0; height: 0; width: 100%; height: 100%; color: #fff; /*动画元素transform-style*/ -webkit-transform-style: preserve-3d; -webkit-transition: .8s ease-in-out ; /*动画元素背后设置为hidden*/ -webkit-backface-visibility: hidden; } #content ul li a p:first-child { /* 绕y轴旋转 */ -webkit-transform: rotateY(0); z-index: 2; } #content ul li a p:last-child { background: url("images/bg.jpg") no-repeat 0 0; -webkit-transform: rotateY(180deg); z-index: 1; } #content ul li a:hover p:first-child { -webkit-transform: rotateY(-180deg); } #content ul li a:hover p:last-child { -webkit-transform: rotateY(0); } #content ul li a p h3 { margin: 0 auto 15px; padding: 15px 0; width: 200px; height: 16px; line-height: 16px; font-size: 14px; text-align: center; border-bottom: 1px #fff dashed; } #content ul li a p p { padding: 0 10px; font-size: 12px; text-indent: 2em; line-height: 18px; } </style>
Okay, in the above CSS you can find the CSS properties mentioned earlier in the article.
1. The most important thing is to understand rotateY, which rotates around the y-axis. RotateY literally rotates around the y-axis. Someone must ask where the y-axis is:
The default center point of the rotated element is the center of rotation (can be modified by transform-origin). The x and y axes are on the graph, and the z axis is the arrow that goes out from the center (it is the arrow that shoots towards your head from the screen).
In our example, the default image rotateY=0; the mouse pointer is rotateY=-180, a negative number means counterclockwise rotation around the y-axis, a positive number means clockwise rotation; the same applies to the other two axes;
The core of our example is that when the mouse points to: picture (p:first-child), it rotates 180 degrees counterclockwise around the y-axis from 0 degrees to -180 degrees; introduction (p:last-child) starts from 180 Rotate 180 degrees counterclockwise around the y-axis to reach 0 degrees. Creates the effect of two counterclockwise rotations together. Some people may ask why the default introduction is not 0 degrees. Note here that the introduction is in a frontal state after being rotated 180 degrees counterclockwise, so when the image is covered, it is equivalent to a 180-degree clockwise rotation from the normal state, because when the mouse points Need to return to normalcy.
Perspective, there is a trick for setting the stage (the parent element of the animation).
Transform-style’s 3D changes are of course 3D, there’s nothing much to say.
There are many more attributes related to the 3D effect of CSS3. If there is a chance, future examples will deliberately use unused ones~
Click to download the source code. .
We welcome everyone’s advice~ By the way, this example needs to be run under chrome. Firefox does not seem to support it very well. Chrome is automatically used, and firebug is rarely used~ Hehe~
I believe it. After reading the case in this article, you have mastered the method. For more exciting information, please pay attention to other related articles on the PHP Chinese website!
Recommended reading:
Detailed explanation of the use of css3 multi-class selector
Detailed explanation of the use of CSS background-attachment
CSS3 animation example of clicking to enlarge
The above is the detailed content of Baidu Tieba's 3D card flop effect. 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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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



You may have encountered the problem of green lines appearing on the screen of your smartphone. Even if you have never seen it, you must have seen related pictures on the Internet. So, have you ever encountered a situation where the smart watch screen turns white? On April 2, CNMO learned from foreign media that a Reddit user shared a picture on the social platform, showing the screen of the Samsung Watch series smart watches turning white. The user wrote: "I was charging when I left, and when I came back, it was like this. I tried to restart, but the screen was still like this during the restart process." Samsung Watch smart watch screen turned white. The Reddit user did not specify the smart watch. Specific model. However, judging from the picture, it should be Samsung Watch5. Previously, another Reddit user also reported

Speaking of ASSASSIN, I believe players will definitely think of the master assassins in "Assassin's Creed". They are not only skilled, but also have the creed of "devoting themselves to the darkness and serving the light". The ASSASSIN series of flagship air-cooled radiators from the appliance brand DeepCool coincide with each other. Recently, the latest product of this series, ASSASSIN4S, has been launched. "Assassin in Suit, Advanced" brings a new air-cooling experience to advanced players. The appearance is full of details. The Assassin 4S radiator adopts a double tower structure + a single fan built-in design. The outside is covered with a cube-shaped fairing, which has a strong overall sense. It is available in white and black colors to meet different colors. Tie

With the arrival of spring, everything revives and everything is full of vitality and vitality. In this beautiful season, how to add a touch of color to your home life? Haqu H2 projector, with its exquisite design and super cost-effectiveness, has become an indispensable beauty in this spring. This H2 projector is compact yet stylish. Whether placed on the TV cabinet in the living room or next to the bedside table in the bedroom, it can become a beautiful landscape. Its body is made of milky white matte texture. This design not only makes the projector look more advanced, but also increases the comfort of the touch. The beige leather-like material adds a touch of warmth and elegance to the overall appearance. This combination of colors and materials not only conforms to the aesthetic trend of modern homes, but also can be integrated into

With its compact size, the ITX platform has attracted many players who pursue the ultimate and unique beauty. With the improvement of manufacturing processes and technological advancements, both Intel's 14th generation Core and RTX40 series graphics cards can exert their strength on the ITX platform, and gamers also There are higher requirements for SFX power supply. Game enthusiast Huntkey has launched a new MX series power supply. In the ITX platform that meets high-performance requirements, the MX750P full-module power supply has a rated power of up to 750W and has passed 80PLUS platinum level certification. Below we bring the evaluation of this power supply. Huntkey MX750P full-module power supply adopts a simple and fashionable design concept. There are two black and white models for players to choose from. Both use matte surface treatment and have a good texture with silver gray and red fonts.

A large model that can automatically analyze the content of PDFs, web pages, posters, and Excel charts is not too convenient for workers. The InternLM-XComposer2-4KHD (abbreviated as IXC2-4KHD) model proposed by Shanghai AILab, the Chinese University of Hong Kong and other research institutions makes this a reality. Compared with other multi-modal large models that have a resolution limit of no more than 1500x1500, this work increases the maximum input image of multi-modal large models to more than 4K (3840x1600) resolution, and supports any aspect ratio and 336 pixels to 4K Dynamic resolution changes. Three days after its release, the model topped the HuggingFace visual question answering model popularity list. Easy to handle

When we use this platform, we should all be familiar with some of the functions above. No matter what aspect we are in, we can see that there are a lot of posts on it. Of course, we can also post on it ourselves. Some posts and so on, so every time you will feel that some choices in different aspects are available, so today, in order to better understand the use of the above functions, and to ensure the quality of our posts, I directly It is possible to delete some of the posts above, but if you don’t know how to do it, today the editor will explain to you how to delete it. Friends who are interested and have ideas, please contact the editor now Let's take a look, I think you'll like it. Delete

In the current era of rapid technological development, laptops have become an indispensable and important tool in people's daily life and work. For those players who have high performance requirements, a laptop with powerful configuration and excellent performance can meet their hard-core needs. With its excellent performance and stunning design, the Colorful Hidden Star P15 notebook computer has become the leader of the future and can be called a model of hard-core notebooks. Colorful Hidden Star P1524 is equipped with a 13th generation Intel Core i7 processor and RTX4060Laptop GPU. It adopts a more fashionable spaceship design style and has excellent performance in details. Let us first take a look at the features of this notebook. Supreme equipped with Intel Core i7-13620H processing

In today's smartphone market, screen quality has become one of the key indicators to measure the overall performance of a mobile phone. iQOO's Neo series has always been committed to providing users with excellent gaming experience and visual enjoyment. The latest product iQOO Neo9SPro+ uses a "Three Good Eye Protection Gaming Screen". Next, let's take a look at the quality of this screen. How brilliant. iQOO Neo9S Pro+ is equipped with a 1.5 KOLED e-sports direct screen, which supports flagship LTPO adaptive refresh rate from 1Hz to 144Hz, which means that it can achieve ultra-low power standby state when displaying static content, and it can also be intelligent during gaming. Switch to dynamic high from 90Hz to 144Hz
