Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Gradient animation not working

Tags:

html

css

gradient

I'm trying to make animated CSS gradient background, I'm generating CSS for gradient on this page: http://www.gradient-animator.com/ Here is the css:

body {
background: linear-gradient(270deg, #18f0b8, #18a2f0, #db5640);
background-size: 600% 600%;
-webkit-animation: Gradient 60s ease infinite;
-moz-animation: Gradient 60s ease infinite;
animation: Gradient 60s ease infinite;
@-webkit-keyframes Gradient {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
}
@-moz-keyframes Gradient {
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
}
@keyframes Gradient { 
    0%{background-position:0% 50%}
    50%{background-position:100% 50%}
    100%{background-position:0% 50%}
}
}

It outputs gradient fine, but it wont animate it. Am I missing something? Here is the fiddle: http://jsfiddle.net/9s9g6ktu/

like image 677
Emir Dupovac Avatar asked May 20 '15 23:05

Emir Dupovac


1 Answers

Yup.... You've got to close off your body css and have your keyframe animations in their own accord. Like this http://jsfiddle.net/9s9g6ktu/1/

like image 196
Jake Taylor Avatar answered Sep 25 '22 00:09

Jake Taylor