Slide image from top to bottom - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image

Description

Slide image from top to bottom

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

.background {
   background-image: url(https://www.java2s.com/style/demo/InternetExplorer.png);
   width: 200px;
   height: 500px;
   background-size: 200px auto;
   background-repeat: no-repeat;
   background-position: 0% -20%;
   animation:bg 5s linear infinite;
   -webkit-animation:bg 5s linear infinite;
}
@keyframes bg<!--   ww  w . j a  va 2s  .  c  om-->
{
   from {background-position: 0% -20%;}
   to {background-position: 0% 120%;}
}
@-webkit-keyframes bg /* Safari and Chrome */
{
   from {background-position: 0% -20%;}
   to {background-position: 0% 120%;}
}


      </style> 
 </head> 
 <body> 
  <div class="background"></div>  
 </body>
</html>

Related Tutorials