这样写对吗?
来源:2-12 空间移动
张小阳_
2022-05-29 22:31:17
相关代码:
<!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>
*{
padding: 0;
margin: 0;
}
.wrapper{
perspective: 800px;
width: 600px;
height: 200px;
margin: 50px auto;
border: 1px solid red;
position: relative;
animation: rotate all infinite ease;
}
.wrapper>div{
position: absolute;
top: 0;
left: 0;
}
.box1{
width: 200px;
height: 200px;
background-color: #5180C0;
transform: rotateX(90deg) translateZ(100px);
}
.box2{
width: 200px;
height: 200px;
background-color: red;
transform: rotateX(-90deg) translateZ(100px);
}
.box3{
width: 200px;
height: 200px;
background-color: tomato;
transform: rotateY(90deg) translateZ(100px);
}
.box4{
width: 200px;
height: 200px;
background-color: orange;
transform: rotateY(-90deg) translateZ(100px);
}
.box5{
width: 200px;
height: 200px;
background-color: chocolate;
transform: rotateY(180deg) translateZ(100px);
}
.box6{
width: 200px;
height: 200px;
background-color: pink;
transform: rotateY(0deg) translateZ(100px);
}
</style>
</head>
<body>
<div class="wrapper">
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box4"></div>
<div class="box5"></div>
<div class="box6"></div>
</div>
</body>
</html>1回答
好帮手慕慕子
2022-05-30
同学你好,代码实现是可以的,继续加油,祝学习愉快~
相似问题