检查作业

来源:2-14 编程练习

慕九州8582357

2021-09-16 21:43:35

<!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:nth-child(1) {

        transform: rotateX(80deg) ;

        background-color: pink;

    }

    .box p:nth-child(2) {

        transform: rotateX(90deg) translateZ(-52px);;

        background-color: green;

    }

    .box p:nth-child(3) {

        transform: rotateX(104deg) translateZ(-106px);;

        background-color: blue;

    }

</style>

</head>

<body>

<div class="box">

    <p></p>

    <p></p>

    <p></p>

</div>

</body>

</html>


写回答

1回答

好帮手慕星星

2021-09-17

同学你好,可以调整第三个元素的位置,让旋转和平移差值一样看着美观一些。如下:

https://img.mukewang.com/climg/6143f3d309cd06af06760434.jpg

代码中多余的分号需要去掉,自己再测试下。

祝学习愉快!

0

0 学习 · 17877 问题

查看课程