Background Color Transitions with CSS3


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. body {
  2. background: white;
  3. -webkit-animation-name: fade;
  4. -webkit-animation-duration: 4s;
  5. -webkit-animation-iteration-count: 1;
  6. }
  7.  
  8. @-webkit-keyframes fade {
  9. 0% {
  10. background: red;
  11. }
  12. 25% {
  13. background: green;
  14. }
  15. 50% {
  16. background: blue;
  17. }
  18. 75% {
  19. background: orange;
  20. }
  21. 100% {
  22. background: white;
  23. }
  24. }
  25.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.