实现Div的3D图片的360度旋转


<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>实现Div的3D图片的360度旋转-岳瑞涛</title>
    <style>
        *{
            font-size: 30px;color: #00DD00; padding:0; margin:0;

        }
        #yrt {
            position: relative;
            height: 300px;
            width: 300px;
            -webkit-perspective: 500;
            margin-top: 200px;
            margin-right: auto;
            margin-left: auto;
        }
        .yueruitao {
            margin: 10px;
            width: 280px;
            height: 280px;
            background-color: #8C0000;
            opacity: 0.3;
            -webkit-transform-style: preserve-3d;
            -webkit-animation: spin 15s infinite linear;
        }
        .yueruitao > div {
            position: absolute;
            top: 40px;
            left: 40px;
            width: 280px;
            height: 200px;
            padding: 10px;
            -webkit-box-sizing: border-box;
        }
        .yueruitao > :first-child {
            background-color: #ffff00;
            -webkit-transform: translateZ(-100px) rotateY(45deg);
        }
        .yueruitao > :last-child {
            background-color: #333;
            -webkit-transform: translateZ(50px) rotateX(20deg);
            -webkit-transform-origin: 50% top;
        }
        /*执行Y轴旋转360度动画*/
        @-webkit-keyframes spin {
            from {-webkit-transform: rotateY(0);}
            to {-webkit-transform: rotateY(360deg);}
        }
    </style>
</head>
<body>
<div id="yrt"><div><a href="http://blog.csdn.net/yueruitao">岳瑞涛</a></div>
    <div class="yueruitao">
        <div><a href="/">http://blog.csdn.net/yueruitao</a></div>
    </div>
</div>
</body>
</html>
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值