Skip to content

Instantly share code, notes, and snippets.

@d-bourdon
Forked from charliepark/rainbow-border.css
Last active October 22, 2019 23:07
Show Gist options
  • Save d-bourdon/c2ad890d910a022536d0a7d93658b60b to your computer and use it in GitHub Desktop.
Save d-bourdon/c2ad890d910a022536d0a7d93658b60b to your computer and use it in GitHub Desktop.
CSS animations to give a div a rainbow border, perpetually changing color
@-webkit-keyframes rainbow {
0% {border-color: hsl(0, 100%, 50%);}
17% {border-color: hsl(60, 100%, 50%);}
34% {border-color: hsl(120, 100%, 50%);}
51% {border-color: hsl(180, 100%, 50%);}
68% {border-color: hsl(240, 100%, 50%);}
85% {border-color: hsl(300, 100%, 50%);}
100% {border-color: hsl(359, 100%, 50%);}
}
.rainbow_border{
border: 4px solid hsl(0, 100%, 50%);
-webkit-animation: rainbow 10s infinite;
-moz-animation: rainbow 10s infinite;
-o-animation: rainbow 10s infinite;
animation: rainbow 10s infinite;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment