Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GradientAnimator/1cce23f1a64c30f1e2ff25f337438525 to your computer and use it in GitHub Desktop.
Save GradientAnimator/1cce23f1a64c30f1e2ff25f337438525 to your computer and use it in GitHub Desktop.
CSS Gradient Animation
.css-selector {
    background: linear-gradient(78deg, #c40bac, #ff0000);
    background-size: 400% 400%;
    -webkit-animation: AnimationName 10s ease infinite;
    -moz-animation: AnimationName 10s ease infinite;
    -o-animation: AnimationName 10s ease infinite;
    animation: AnimationName 10s ease infinite;
}
@-webkit-keyframes AnimationName {
    0%{background-position:0% 18%}
    50%{background-position:100% 83%}
    100%{background-position:0% 18%}
}
@-moz-keyframes AnimationName {
    0%{background-position:0% 18%}
    50%{background-position:100% 83%}
    100%{background-position:0% 18%}
}
@-o-keyframes AnimationName {
    0%{background-position:0% 18%}
    50%{background-position:100% 83%}
    100%{background-position:0% 18%}
}
@keyframes AnimationName {
    0%{background-position:0% 18%}
    50%{background-position:100% 83%}
    100%{background-position:0% 18%}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment