当前位置:网站首页>翻牌效果
翻牌效果
2022-04-23 14:09:00 【瑞瑞小同学】
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
/* div{
position: relative;
margin: 100px auto;
width: 224px;
height: 224px;
}
div img{
position: absolute;
left: 0;
top: 0;
transition: all 2s;
}
div img:first-child{
z-index: 1;
backface-visibility: hidden;
}
div:hover img{
transform: rotateY(180deg);
} */
/* Classes that will show or hide the
three back faces of the "cube" */
.showbf div {
backface-visibility: visible;
}
.hidebf div {
backface-visibility: hidden;
}
/* Define the container div, the cube div, and a generic face */
.container {
width: 150px;
height: 150px;
margin: 75px 0 0 75px;
border: none;
}
.cube {
width: 100%;
height: 100%;
perspective: 550px;
perspective-origin: 150% 150%;
transform-style: preserve-3d;
}
.face {
display: block;
position: absolute;
width: 100px;
height: 100px;
border: none;
line-height: 100px;
font-family: sans-serif;
font-size: 60px;
color: white;
text-align: center;
}
/* Define each face based on direction */
.front {
background: rgba(0, 0, 0, 0.3);
transform: translateZ(50px);
}
.back {
background: rgba(0, 255, 0, 1);
color: black;
transform: rotateY(180deg) translateZ(50px);
}
.right {
background: rgba(196, 0, 0, 0.7);
transform: rotateY(90deg) translateZ(50px);
}
.left {
background: rgba(0, 0, 196, 0.7);
transform: rotateY(-90deg) translateZ(50px);
}
.top {
background: rgba(196, 196, 0, 0.7);
transform: rotateX(90deg) translateZ(50px);
}
.bottom {
background: rgba(196, 0, 196, 0.7);
transform: rotateX(-90deg) translateZ(50px);
}
/* Make the table a little nicer */
th, p, td {
background-color: #EEEEEE;
margin: 0px;
padding: 6px;
font-family: sans-serif;
text-align: left;
}
</style>
</head>
<body>
<!-- <div>
<img class="a" src="img/35.jpg" alt="">
<img class="b" src="img/36.jpg" alt="">
</div> -->
<table>
<tr>
<th><code>backface-visibility: visible;</code></th>
<th><code>backface-visibility: hidden;</code></th>
</tr>
<tr>
<td>
<div class="container">
<div class="cube showbf">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
<p>
Since all faces are partially transparent,
the back faces (2, 4, 5) are visible
through the front faces (1, 3, 6).
</p>
</td>
<td>
<div class="container">
<div class="cube hidebf">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
<p>
The three back faces (2, 4, 5) are
hidden.
</p>
</td>
</tr>
</table>
</body>
</html>
版权声明
本文为[瑞瑞小同学]所创,转载请带上原文链接,感谢
https://blog.csdn.net/yr123456654321/article/details/111599373
边栏推荐
- 多云数据流转?云上容灾?年前最后的价值内容分享
- Some good articles on pthread multithreading
- Wechat applet communicates with low-power Bluetooth - sending data to hardware (III)
- Pass in external parameters to the main function in clion
- 微信小程序客服接入,实现发送和接收消息
- 帆软分割求解:一段字符串,只取其中某个字符(所需要的字段)
- 帆软之单元格部分字体变颜色
- MySQL lock database lock
- 百度笔试2022.4.12+编程题目:简单整数问题
- Request module
猜你喜欢

Storage path of mod subscribed by starbound Creative Workshop at Star boundary

Idea控制台乱码解决

Wechat applet positioning and ranging through low-power Bluetooth device (2)

更改plsql工具栏的图标大小

统信UOS PHP7.2.3升级至PHP7.2.24

MySQL数据库讲解(九)

帆软中使用if else 进行判断-使用标题条件进行判断

HyperMotion云迁移助力中国联通,青云完成某央企上云项目,加速该集团核心业务系统上云进程

连接公司跳板机取别名

Recyclerview advanced use (I) - simple implementation of sideslip deletion
随机推荐
Wechat applet input hidden and inoperable settings
连接公司跳板机取别名
Visio installation error 1:1935 2: {XXXXXXXX
MySQL基础知识
MySQL-InnoDB-事务
微信小程序客服接入,实现发送和接收消息
How to do a project easily
gzip和gunzip 解压参数详解
Idea控制台乱码解决
云迁移的六大场景
字节面试编程题:最小的K个数
数据库DbVisualizer Pro报文件错误,导致数据连接失败
Redis数据库讲解(一)
Get the thread return value. Introduction to the use of future interface and futuretask class
文字组合,不重复,做搜索或查询关键字匹配
Algorithem_ReverseLinkedList
findstr不是内部或外部命令解决方法
std::map 和 std::vector 内存释放
MySQL数据库讲解(八)
STD:: map and STD:: vector memory free