3D导航栏

 前面那个面需要向前移动盒子的一半创建立体空间,才能使整个盒子旋转90度后能全部覆盖住

<body>
    <ul>
        <li>
            <div class="box">
                <div class="front">8989</div>
                <div class="bottom">WOAINA</div>
            </div>
        </li>
    </ul>
</body>
<style>
        * {
            margin: 0;
            padding: 0;
        }

        ul {
            width: 520px;
            background-color: antiquewhite;
            display: flex;
            justify-content: space-between;
            margin: 100px;
        }

        ul li {
            width: 120px;
            height: 35px;
            perspective: 500px;
            list-style: none;
        }

        .box {
            position: relative;
            width: 100%;
            height: 100%;
            transform-style: preserve-3d;
            transition: all 1S;
        }

        .box:hover {
            transform: rotateX(90deg);
        }

        .front,
        .bottom {
            width: 100%;
            height: 100%;
            position: absolute;
            text-align: center;
            line-height: 35px;
        }

        .front {
            background-color: pink;
            transform: translateZ(17.5px);
            z-index: 1;
        }

        .bottom {
            background-color: blue;
            transform: translateY(17.5px) rotateX(-87deg);
        }
    </style>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值