CSS animation of body background-color - HTML CSS CSS Animatable Property

HTML CSS examples for CSS Animatable Property:background

Description

CSS animation of body background-color

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

body {<!--from   www. ja v a2s.c  om-->
   animation: mainscreen 3s linear infinite alternate;
   -webkit-animation: mainscreen 3s linear infinite alternate;
}
@-webkit-keyframes mainscreen {
   0%   {background-color: #00F900}
   12.5%  {background-color: #3363FF}
   25%  {background-color: #993399}
   37.5%  {background-color: #FF85E0}
   50% {background-color: #F9E600}
   62.5% {background-color: #FF9900}
   75% {background-color: #FF1919}
   87.5% {background-color: #FDFDFD}
   100% {background-color: #000000}
}
@keyframes mainscreen {
   0%   {background-color: #00F900}
   12.5%  {background-color: #3363FF}
   25%  {background-color: #993399}
   37.5%  {background-color: #FF85E0}
   50% {background-color: #F9E600}
   62.5% {background-color: #FF9900}
   75% {background-color: #FF1919}
   87.5% {background-color: #FDFDFD}
   100% {background-color: #000000}
}


      </style> 
 </head> 
 <body>  
 </body>
</html>

Related Tutorials