Test1.html

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
}
.wrap{
margin: 50px auto;
width: 200px;
padding: 200px;
perspective: 800px;
border: 1px dashed #333;
}
.box{
position: relative;
width: 200px;
height: 200px;
line-height: 200px;
font-size: 100px;
text-align: center;
color: #fff;
font-weight: bold;
border: 1px dashed #ccc;
transform-style: preserve-3d;
transform-origin: center center -100px;/*定位的方式,旋转中心点这样设置,但存在兼容性问题*/
transition: 1s;
}
.box div{
position: absolute;
width: 200px;
height: 200px;
}
.box div:nth-of-type(1){
top: -200px;
background-color: red;
transform-origin: bottom;
transform: rotateX(90deg);
}
.box div:nth-of-type(2){
left: -200px;
background-color: green;
transform-origin: right;
transform: rotateY(-90deg);
}
.box div:nth-of-type(3){
background-color: blue;
}
.box div:nth-of-type(4){
right: -200px;
background-color: #333;
transform-origin: left;
transform: rotateY(90deg);
}
.box div:nth-of-type(5){
bottom: -200px;
background-color: yellow;
transform-origin: top;
transform: rotateX(-90deg);
}
.box div:nth-of-type(6){
background-color: tan;
transform: translateZ(-200px) rotateX(180deg);
}
.wrap:hover .box{
transform: rotateX(360deg);
}
</style>
</head>
<body>
<div class="wrap">
<div class="box">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</div>
</div>
</body>
</html>

Test2.html

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
}
.wrap{
margin: 50px auto;
width: 200px;
padding: 200px;
perspective: 800px;
border: 1px dashed #333;
}
.box{
position: relative;
width: 200px;
height: 200px;
line-height: 200px;
font-size: 100px;
text-align: center;
color: #fff;
font-weight: bold;
border: 1px dashed #ccc;
transform-style: preserve-3d;
transform-origin: center center -100px;/*定位的方式,旋转中心点这样设置,但存在兼容性问题*/
transition: 1s;
}
.box div{
position: absolute;
width: 200px;
height: 200px;
}
.box div:nth-of-type(1){
top: -200px;
background-color: red;
transform-origin: bottom;
transform: rotateX(90deg);
}
.box div:nth-of-type(2){
left: -200px;
background-color: green;
transform-origin: right;
transform: rotateY(-90deg);
}
.box div:nth-of-type(3){
background-color: blue;
}
.box div:nth-of-type(4){
right: -200px;
background-color: #333;
transform-origin: left;
transform: rotateY(90deg);
}
.box div:nth-of-type(5){
bottom: -200px;
background-color: yellow;
transform-origin: top;
transform: rotateX(-90deg);
}
.box div:nth-of-type(6){
background-color: tan;
transform: translateZ(-200px) rotateX(180deg);
}
.wrap:hover .box{
transform: rotateX(360deg);
}
</style>
</head>
<body>
<div class="wrap">
<div class="box">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</div>
</div>
</body>
</html>

Test3.html

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
/*不用麻烦设置left,top等值*/
.wrap{
margin: 0 auto;
width: 200px;
height: 200px;
padding: 200px;
border: 1px solid #333;
perspective: 800px;/*!!!*/
}
.box{
width: 200px;
height: 200px;
position: relative;
transform-style: preserve-3d;/*!!!*/
transition: 3s all;
transform: translateZ(-100px) rotateX(0);
}
.box div{
width: 200px;
height: 200px;
line-height: 200px;
color: #fff;
position: absolute;
font-size: 100px;
text-align: center;
}
.box div:nth-of-type(1){
background-color: red;
transform: translateZ(100px);
}
.box div:nth-of-type(2){
background-color: blue;
transform-origin: top;
transform: translateZ(-100px) rotateX(90deg);/*!!!先移到最里面再操作能保证数字是正的,然后再向前移动,然后再控制其父向后移动*/
}
.box div:nth-of-type(3){
background-color: yellow;
transform: translateZ(-100px) rotateX(180deg);/*!!!*/
}
.box div:nth-of-type(4){
background-color: green;
transform-origin: bottom;
transform: translateZ(-100px) rotateX(-90deg);/*!!!*/
}
.wrap:hover .box{
transform: translateZ(-100px) rotateX(270deg);
}
</style>
</head>
<body>
<div class="wrap">
<div class="box">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</div>
</div>
</body>
</html>

最新文章

  1. 安卓Socket连接实现连接实现发送接收数据,openwrt wifi转串口连接单片机实现控制
  2. 关于SAX
  3. ABP入门系列(3)——领域层创建实体
  4. 第一个JSP程序
  5. (转)supertable像excel那样固定table的表头和第一列
  6. matlab:对一个向量进行排序,返回每一个数据的rank 序号 。。。
  7. 在Where中对列使用函数,将导致其不可索引
  8. modelsim仿真错误解决办法
  9. socket通信简单介绍
  10. javaweb学习总结十五(web开发的相关概念以及常用服务器介绍)
  11. C# - 自动属性
  12. [PWA] Keynote: Progressive Web Apps across all frameworks
  13. 关于Struts2的碎碎念
  14. FC105 FC106 Scale功能块使用说明
  15. jQuery初识、函数、对象
  16. vue-cli笔记
  17. 【线程】Volatile关键字
  18. GTD实践2周年后一些体会
  19. Spring AOP注解为什么失效?90%Java程序员不知道
  20. WebGl 二维纹理贴图(矩形)

热门文章

  1. uint8_t / uint16_t / uint32_t /uint64_t 是什么数据类型 - 大总结
  2. Windows 命令集合
  3. 果园里有一堆苹果,一共n头(n大于1小于9)熊来分,第一头为小东,它把苹果均分n份后,多出了一个,它扔掉了这一个,拿走了自己的一份苹果,接着第二头熊重复这一过程,即先均分n份,扔掉一个然后拿走一份,以此类推直到最后一头熊都是这样(最后一头熊扔掉后可以拿走0个,也算是n份均分)。问最初这堆苹果最少有多少个。
  4. 【selenium+Python WebDriver API】之复选框顺序正选和顺序反选
  5. Docker入门系列1:简介
  6. HDU 1452 Happy 2004(唯一分解定理)
  7. cmake的外部编译
  8. JavaScript如何判断非空
  9. servlet 复习笔记
  10. 利用iOS原生系统进行人脸识别+自定义滤镜(GPUImage)