2021-07-03

3D滑动块

    <style>
        body{
            background-color: black;
            position: relative;
            transform-style: preserve-3d;
            perspective: 3000px;
        }
        .box_big{
            /* float: left; */
        }
        .box{
            float: left;
            margin-top: 100px;
            margin-left: 80px;
            /* position: absolute; */
            /* left: 80px; */
            width: 100px;
            height: 80px;
            border: 2px solid white;
        }
        .one{
            transform:translateZ(0px);
            /* position: absolute; */

        }
        .two{
            transform:translateZ(0px);
        }
        .three{
            transform:translateZ(0px);
        }
        .four{
            transform:translateZ(0px);
        }
        .five{
            transform:translateZ(0px);
        }
        .six{
            transform:translateZ(0px);
            
        }

        .one:hover {
            transform:translateZ(150px);
            background-color:rgb(250, 4, 4) ;
            box-shadow: 0px 0px 150px 0px rgb(250, 4, 4,0.4) ;

        }
        .two:hover {
            transform:translateZ(150px);
            background-color: rgba(255, 145, 0, 0.4);
            box-shadow: 0px 0px 150px 0px rgba(255, 145, 0, 0.4);
        }
        .three:hover {
            transform:translateZ(150px);
            background-color: rgba(51, 255, 0, 0.4);
            box-shadow: 0px 0px 150px 0px rgba(51, 255, 0, 0.4);
        }
        .four:hover {
            transform:translateZ(150px);
            background-color: rgba(35, 0, 189, 0.4);
            box-shadow: 0px 0px 150px 0px rgba(35, 0, 189, 0.4);
        }
        .five:hover {
            transform:translateZ(150px);
            background-color: rgba(255, 0, 149, 0.4);
            box-shadow: 0px 0px 150px 0px rgba(255, 0, 149, 0.4);
        }
        .six:hover {
            transform:translateZ(150px);
            background-color: rgba(0, 255, 115, 0.4);
            box-shadow: 0px 0px 150px 0px rgba(0, 255, 115, 0.4);
        }
    </style>


<body>
    <div class="box_big">
        <div class="box one"></div>
        <div class="box two"></div>
        <div class="box three"></div>
        <div class="box four"></div>
        <div class="box five"></div>
        <div class="box six"></div>
    </div>
</body>
</html>

3D

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值