<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>3D</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
body{
perspective: 1000px;
perspective-origin: 50% 50%;
}
.bigbox{
position: relative;
transform-style: preserve-3d;
width: 400px;
height: 400px;
/* border: 2px solid black; */
margin: 200px auto;
animation: xz 3s infinite linear;
}
@keyframes xz{
from{
transform: rotate3d(0,0,0,0);
}
to{
transform: rotate3d(1,1,1,360deg);
}
}
.bigbox div{
position: absolute;
left: 0;
top: 0;
width: 400px;
height: 400px;
border: 2px solid red;
transition: all .4 linear;
}
.bigbox div:nth-child(1){
transform: translateY(200px) rotateX(90deg);
}
.bigbox div:nth-child(2){
transform: translateY(-200px) rotateX(90deg);
}
.bigbox div:nth-child(3){
transform: translateX(200px) rotateY(90deg);
}
.bigbox div:nth-child(4){
transform: translateX(-200px) rotateY(90deg);
}
.bigbox div:nth-child(5){
transform: translateZ(200px);
}
.bigbox div:nth-child(6){
transform: translateZ(-200px);
}
</style>
</head>
<body>
<div class="bigbox">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</div>
</body>
</html>
07-23
05-31
254
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-15
357
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-01
4939
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-05
1892
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-10