css样式部分
<style>
*{
margin: 0;padding: 0;
}
section{
width: 400px;
height: 400px;
background: black;
position: fixed;
top: 0;bottom: 0;
left: 0;right: 0;
margin:auto;
transform-style: preserve-3d;
transform: rotateX(30deg) rotateY(30deg);
}
div{
width: 400px;
height: 400px;
font-size: 100px;
color: #fff;
text-align: center;
line-height: 400px;
font-weight: 900;
position: absolute;
opacity: 0.6;
}
div:nth-child(1){
background: orange;
transform: translateZ(200px);
}
div:nth-child(2){
background: blue;
transform: translateZ(-200px) rotateY(180deg);
}
div:nth-child(3){
background:pink;
transform: translateY(-200px) rotateX(90deg);
}
div:nth-child(4){
background:green;
transform: translateY(200px) rotateX(-90deg);
}
div:nth-child(5){
background: red;
transform: translateX(-200px) rotateY(-90deg);
}
div:nth-child(6){
background:purple;
transform: translateX(200px) rotateY(90deg);
}
</style>
body部分
<section>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</section>
