旋转木马 CSS3

<!DOCTYPE html>

<head>

<title>Document</title>

<style>

        body{

            perspective: 1000px;

        }

        .boxs {

            position: relative;

            width: 140px;

            height: 140px;

            margin: 100px auto;

            transform-style: preserve-3d;

            animation: move 10s linear infinite;

            background: url(images/7.jpg);

        }

        .boxs:hover{

          animation-play-state: paused;

        }

        @keyframes move {

            0%{

            }

            100%{

                transform: rotateY(360deg);

            }


        }

        .boxs div {

            position: absolute;

            width: 100%;

            height: 100%;

            left: 0;

            top: 0;

        }

        .boxs div:nth-child(1) {

            background: url(images/1.jpg);

            transform: rotateY(0) translateZ(300px);

        }

        .boxs div:nth-child(2) {

            background: url(images/2.jpg);

            transform: rotateY(60deg) translateZ(300px);

        }

        .boxs div:nth-child(3) {

            background: url(images/3.jpg);

            transform: rotateY(120deg) translateZ(300px);

        }

        .boxs div:nth-child(4) {

            background: url(images/4.jpg);

            transform: rotateY(180deg) translateZ(300px);

        }

        .boxs div:nth-child(5) {

            background: url(images/5.jpg);

            transform: rotateY(240deg) translateZ(300px);

        }

        .boxs div:nth-child(6) {

            background: url(images/6.jpg);

            transform: rotateY(300deg) translateZ(300px);

        }

</style>

</head>

<body>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

</div>

</body>

</html>

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容