html+css立方体特效

5 篇文章 0 订阅

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>长方体特效</title>
        <style type="text/css">
            ul{
                width: 600px;
                height: 560px;
                list-style: none;
                position: relative;
                margin: 0 auto;
                transform: rotateX(0deg)rotateY(30deg);
                transform-style: preserve-3d;
                animation: zz 10s infinite;
            }
            @keyframes zz{
                0%{transform: rotateX(0deg) rotateY(0deg);}
                25%{transform: rotateX(0deg) rotateY(360deg);}
                50%{transform: rotateX(0deg) rotateY(0deg);}
                100%{transform: rotateX(360deg) rotateY(0deg);}
            }
            .front>img{
                width: 100%;
                height: 100%;
            }
            .behind>img{
                width: 100%;
                height: 100%;
            }
            .left>img{
                width: 100%;
                height: 100%;
            }
            .right>img{
                width: 100%;
                height: 100%;
            }
            .top>img{
                width: 100%;
                height: 100%;
            }
            .bottom>img{
                width: 100%;
                height: 100%;
            }
            .left{
                width: 200px;
                height: 200px;
                transform: rotateY(-90deg) translateZ(100px);
                background-color: red;
                position: absolute;
                left: 100px;
                top: 150px;
            }
            .right{
                width: 200px;
                height: 200px;
                transform: rotateY(90deg) translateZ(100px);
                background-color: blue;
                position: absolute;
                right: 140px;
                top: 150px;
            }
            .front{
                width: 400px;
                height: 200px;
                transform: translateZ(100px);
                background-color: sandybrown;
                position: absolute;
                left: 100px;
                top: 150px;
            }
            .behind{
                width: 400px;
                height: 200px;
                transform: translateZ(-100px);
                background-color: brown;
                position: absolute;
                left: 100px;
                top: 150px;
            }
            .top{
                width: 400px;
                height: 200px;
                background-color: green;
                transform: rotateX(90deg);
                position: absolute;
                top: 50px;
                left: 100px;
            }
            .bottom{
                width: 400px;
                height: 200px;
                background-color: cornflowerblue;
                transform: rotateX(90deg);
                position: absolute;
                left: 100px;
                top: 250px;
            }
        </style>
    </head>
    <body>
        <ul>
            <li class="front"><img src="img/qian.jpg" ></li>
            <li class="behind"><img src="img/1.jpg" ></li>
            <li class="top"><img src="img/shang.jpg" ></li>
            <li class="bottom"><img src="img/xia.jpg" ></li>
            <li class="left"><img src="img/you.jpg" ></li>
            <li class="right"><img src="img/zuo.jpg" ></li>
        </ul>
    </body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值