连续的CSS过渡

Sin*_*nan 6 css3 css-transitions

有没有办法background-position使用CSS3过渡连续动画背景图像的属性?

Zol*_*oth 16

是的,这是可能的 - DEMO

div
{
    background: url(http://lorempixel.com/100/100);
    height: 100px;
    width: 100px;

    -webkit-animation: slide 2s linear infinite;
       -moz-animation: slide 2s linear infinite;
            animation: slide 2s linear infinite;
}


@-webkit-keyframes slide
{
    0%   {background-position: 0 0;}
    100% {background-position: 100px 0;}
}?

@-moz-keyframes slide
{
    0%   {background-position: 0 0;}
    100% {background-position: 100px 0;}
}

@keyframes slide
{
    0%   {background-position: 0 0;}
    100% {background-position: 100px 0;}
}
Run Code Online (Sandbox Code Playgroud)