CSS Brightness and Contrast Animation - HTML CSS CSS Animation

HTML CSS examples for CSS Animation:Color

Description

CSS Brightness and Contrast Animation

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">

div {<!-- ww w . ja v  a  2s  .com-->
   background: red;
   width: 200px;
   height: 200px;
   animation-name: example;
   animation-duration: 4s;
   animation-iteration-count: infinite;
}
@keyframes example {
   0%   {
      filter: brightness(1);
      filter: contrast(1);
      -webkit-filter: brightness(1);
      -webkit-filter: contrast(1);
   }
   50%  {
      filter: brightness(0.4);
      filter: contrast(0.4);
      -webkit-filter: brightness(0.4);
      -webkit-filter: contrast(0.4);
   }
   100% {
      filter: brightness(1);
      filter: contrast(1);
      -webkit-filter: brightness(1);
      -webkit-filter: contrast(1);
   }
}


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

Related Tutorials