请老师检查
来源:2-14 编程练习
weixin_慕尼黑0465866
2021-11-17 14:56:30
<!Doctype html>
<html>
<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;
}
/* 补充代码 */
p:nth-child(1){
background-color:rgba(255,0,0,0.6);
transform:rotateX(80deg) translateZ(30px);
}
p:nth-child(2){
background-color:rgba(0,255,0,0.6);
transform:rotateX(85deg);
}
p:nth-child(3){
background-color:rgba(0,0,255,0.6);
transform:rotateX(90deg) translateZ(-30px);;
}
</style>
</head>
<body>
<div class="box">
<p></p>
<p></p>
<p></p>
</div>
</body>
</html>
1回答
好帮手慕小李
2021-11-17
同学你好,效果完成很不错,很棒~
优化建议:css中多了个分号如下图。

祝学习愉快~
相似问题