css实现正方体旋转效果
style样式
*{
margin: 0; padding: 0;}
li{
list-style: none;}
body{
background: url('image/ma.jpg') 0 0 no-repeat;/* 自己更换背景图片 */
background-size: cover;
}
.body{
transform-style: preserve-3d;
}
.box{
width: 400px;
height: 400px;
/* border: 2px solid red;m */
margin: 400px auto;
transform-style: preserve-3d;
position: relative;
perspective: 1000px;
}
.list{
width: 400px;
height:400px;
/* background: red; */
position: absolute;
left: 0;
top: 0;
transform-style: preserve-3d;
transform: rotateX(-30deg) rotateY(-30deg);
animation: run 5s linear infinite;
}
.list-l{
width: 200px;
height: 200px;
/* background: red; */
position: absolute;
left: 100px;
top: 100px;
transform-style: preserve-3d;
transform: rotateX(-30deg) rotateY(-30deg);
animation: run 5s linear infinite;
}
.list li{
width: 400px;
height: 400px;
font-size: 100px;
color: red;
text-align: center;
line-height: 400px;
position: absolute;
top: 0;
left: 0;
/* transition: all 2s linear; */