请老师检查

来源:2-14 编程练习

踩一个脚印

2022-09-20 20:28:33

<!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;
    }
    /* 补充代码 */
    .box p:first-child{
        background-color:red;
        transform:rotateX(75deg) translateZ(58px);
    }
    .box p:nth-child(2){
        background-color:green;
        transform:rotateX(80deg) translateZ(30px);
    }
    .box p:last-child{
        background-color:blue;
        transform:rotateX(86deg);
    }
</style>
</head>
<body>
<div class="box">
    <p></p>
    <p></p>
    <p></p>
</div>
</body>
</html>

问题描述:

老师看一下我的代码正确吗?我做出来的效果三个盒子看着是一样大的,但是练习中的效果图看着三个盒子是不一样大小的,最上面红色的小,最下面的最大,而要求中只是让绕x轴旋转和绕z轴平移

写回答

1回答

好帮手慕星星

2022-09-20

同学你好,代码实现效果可以。

效果图中三个盒子是大小一样的, 只是旋转角度问题,可以忽略。

祝学习愉快!

0

0 学习 · 17877 问题

查看课程