旋转轮播图

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>旋转轮播图</title>
    <style>
    body{
        perspective: 1000px;

    }
        section {
            width: 300px;
            height: 200px;
            margin: 100px auto;
            background:  url(images/chu.jpg) no-repeat;
            -webkit-background-size: cover;
            background-size: cover;
            position: relative;
            -webkit-transform-style: preserve-3d;
            -moz-transform-style: preserve-3d;
            -ms-transform-style: preserve-3d;
            transform-style: preserve-3d;
            -webkit-animation: moving 5s linear infinite;
            -o-animation: moving 5s linear infinite;
            animation: moving 5s linear infinite;
        }
        @keyframes moving {
            from {
                transform: rotateY(0deg);
            }
            to {
                transform: rotateY(360deg);
            }
            
        }
        section div {
            width: 100%;
            height: 100%;
            background:  url(images/mi.jpg) 0 0 no-repeat;
            -webkit-background-size: 100% 100%;
            background-size: 100% 100%;
            position: absolute;
            left:0;
            top:0;

        }
        section:hover  {
            animation-play-state: paused;

        }
        section div:nth-child(1) {
            transform: rotateY(0deg) translateZ(400px);

        }
        section div:nth-child(2) {
            transform: rotateY(60deg) translateZ(400px);

        }
        section div:nth-child(3) {
            transform: rotateY(120deg) translateZ(400px);

        }
        section div:nth-child(4) {
            transform: rotateY(180deg) translateZ(400px);

        }
        section div:nth-child(5) {
            transform: rotateY(240deg) translateZ(400px);

        }
        section div:nth-child(6) {
            transform: rotateY(300deg) translateZ(400px);

        }

    </style>
</head>
<body>
    <section>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </section>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/weixin_40098371/article/details/81607779
今日推荐