技术:
animation: donghua 5s linear infinite;
transform: translateX(-100px) rotateY(-90deg);

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
.box{
width: 500px;
height: 500px;
border: 5px solid #000;
margin: 50px auto;
/* 父元素变为旋转舞台 */
transform-style: preserve-3d;
transform: rotateY(50deg) rotateX(50deg);
position: relative;
animation: donghua 5s linear infinite;
}
.box>div{
width: 200px;
height: 200px;
font-size: 100px;
text-align: center;
line-height: 200px;
position: absolute;
left: 150px;
top: 150px;
}
/* 前 */
.box>div:nth-child(1){
background-color: rgb(247, 228, 199);
transform: translateZ(100px) ;
}
/* 左 */
.box>div:nth-child(2){
background-color: rgb(248, 195, 195);
/* 先平移后旋转 */
transform: translateX(-100px) rotateY(-90deg);
}
/* 上 */
.box>div:nth-child(3){
background-color: rgb(198, 245, 239);
transform: translateY(-100px) rotateX(90deg);
}
/* 下 */
.box>div:nth-child(4){
background-color: rgb(241, 185, 207);
transform: translateY(100px) rotateX(-90deg);
}
/* 右 */
.box>div:nth-child(5){
background-color: rgb(243, 209, 220);
transform: translateX(100px) rotateY(90deg);
}
/* 后 */
.box>div:nth-child(6){
background-color: rgb(228, 205, 245);
transform: translateZ(-100px) rotateY(180deg);
}

@keyframes donghua{
0%{
transform: rotateX(20deg) rotateY(20deg) ;

}
50%{
transform: rotateX(360deg) rotateY(360deg);
}
100%{
transform: rotateX(20deg) rotateY(20deg) ;
}
}
</style>
</head>
<body>
<div class="box">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</div>
</body>
</html>

[css3] 小案例---旋转立方体_html

[css3] 小案例---旋转立方体_html_02