Question

I cannot figure out why animations of background-position aren't working on my version of Chrome of Safari (Webkit Browsers). It's working fine on Firefox.

@keyframes animatedBackground {
  from {
    background-position: 0px 0px; }

  to {
    background-position: 100% 0px; } 
}

.logo {
  width: 600px;
  height: 300px;
  background-image: url("http://placekitten.com/g/200/300");
  background-position: 0px 0px;

  -webkit-animation: animatedBackground 10s linear infinite;
  -moz-animation: animatedBackground 10s linear infinite;
  animation: animatedBackground 10s linear infinite; 
}

http://jsfiddle.net/LkeMitchll/kpBby/2/

Any help greatly appreciated!.

LM.

Was it helpful?

Solution

You need to prefix @keyframes with the browser-specific prefix "-webkit" as well, see W3Schools

Try adding this to your CSS:

@-webkit-keyframes animatedBackground {
  from {
    background-position: 0px 0px; }

  to {
    background-position: 100% 0px; } 
}

Fixed fiddle: http://jsfiddle.net/kpBby/3/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top