纯CSS实现的图片切换效果

2015-12-14 0 239
纯CSS实现的图片切换效果
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>CSS3实现轮播图效果</title>
<style>
    @-webkit-keyframes slide {
        0% {
            background-position: 0 0;
        }
        10%, 25% {
            background-position: -600px 0;
        }
        35%, 50% {
            background-position: -1200px 0;
        }
        60%, 75% {
            background-position: -1800px 0;
        }
        85%, 100% {
            background-position: 0 0;
        }
    }
    @-moz-keyframes slide {
        0% {
            background-position: 0 0;
        }
        10%, 25% {
            background-position: -600px 0;
        }
        35%, 50% {
            background-position: -1200px 0;
        }
        60%, 75% {
            background-position: -1800px 0;
        }
        85%, 100% {
            background-position: 0 0;
        }
    }
    @-o-keyframes slide {
        0% {
            background-position: 0 0;
        }
        10%, 25% {
            background-position: -600px 0;
        }
        35%, 50% {
            background-position: -1200px 0;
        }
        60%, 75% {
            background-position: -1800px 0;
        }
        85%, 100% {
            background-position: 0 0;
        }
    }
    @keyframes slide {
        0% {
            background-position: 0 0;
        }
        10%, 25% {
            background-position: -600px 0;
        }
        35%, 50% {
            background-position: -1200px 0;
        }
        60%, 75% {
            background-position: -1800px 0;
        }
        85%, 100% {
            background-position: 0 0;
        }
    }
    .slide-box {
        margin: 0 auto;
        width: 600px;
        height: 400px;
        border: 1px solid #ddd;
        background: url(http://sandbox.runjs.cn/uploads/rs/376/uazzmdfd/bg.png) 0 0 no-repeat;
        -webkit-animation: slide 8s linear infinite;
        -o-animation: slide 8s linear infinite;
        animation: slide 8s linear infinite;
    }
</style>
</head>
<body>
    <div class="slide-box"></div>
</body>
</html>

遇见资源网 css 纯CSS实现的图片切换效果 http://www.ox520.com/14554.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务