请老师检查一下,谢谢。
来源:2-14 编程练习
慕斯卡2474635
2021-07-09 18:35:26
<!Doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>空间移动</title>
<style>
* {
margin: 0;
padding: 0;
}
.box {
width: 200px;
height: 200px;
margin: 200px auto;
perspective: 300px;
position: relative;
}
.box p {
position: absolute;
left: 0;
top: 0;
width: 200px;
height: 200px;
}
/* 补充代码 */
.box p:nth-child(1) {
background-color: rgb(255,0,0,.55);
transform:rotateX(78deg) translatez(32px);
}
.box p:nth-child(2) {
background-color: rgba(46, 236, 46, 0.55);
transform:rotateX(84deg) translatez(-2px);
}
.box p:nth-child(3) {
background-color: rgb(49, 49, 247,.55);
transform:rotateX(91deg) translatez(-36px);
}
</style>
</head>
<body>
<div class="box">
<p></p>
<p></p>
<p></p>
</div>
</body>
</html>
1回答
同学你好,代码实现效果很棒。继续加油,祝学习愉快!
相似问题