0
点赞
收藏
分享

微信扫一扫

css 动画3d旋转案例


css 动画3d旋转案例_屏幕截图

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body {
            perspective: 500px;
        }
        .box {
            position: relative;
            width: 500px;
            height: 500px;
            margin: 100px auto;
            transform-style: preserve-3d;   /*让子元素保持3d立体空间*/
            background: url('../屏幕截图(100).png') no-repeat;
            transition: all 4s;
        }
        .box:hover{
            transform: rotateY(360deg);
        }
        .box div {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: url('../屏幕截图(19).png');
            background-position: -150px -150px;
            transition: all 4s;
        }

        .box div:hover   {
            transform: rotateX(180deg);
        }
    </style>
</head>
<body>
    <div class="box">
        <div>

        </div>
    </div>
</body>
</html>


举报

相关推荐

0 条评论