请问有优化的地方吗

来源:2-14 编程练习

mewolmewo

2021-03-02 21:16:19

<!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 .p1 {

        background-color:blue;

        transform:rotateX(91deg) translateZ(-29px);

    }

    .box .p2 {

        background-color:red;

        transform:rotateX(262deg) translateZ(-20px);

    }

    .box .p3 {

        background-color:green;

        transform:rotateX(266deg) translateZ(5px);

    }

</style>

</head>

<body>

<div class="box">

    <p class="p1"></p>

    <p class="p2"></p>

    <p class="p3"></p>

</div>

</body>

</html>

   


写回答

1回答

好帮手慕星星

2021-03-03

同学你好,代码实现效果可以,不需要优化了。继续加油,祝学习愉快!

0

0 学习 · 15276 问题

查看课程