Slide background image with transition animation - HTML CSS CSS

HTML CSS examples for CSS:Animation

Description

Slide background image with transition 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">
.example {<!--from   w  w w. j  a  va2  s. c o  m-->
   border:2px solid Chartreuse;
   height:501px;
   width:501px;
   position:relative;
   overflow:hidden;
}

.example:hover .backgroundImage {
   top:0%;
}

.backgroundImage {
   background:url('http://www.java2s.com/style/demo/Google-Chrome.png') no-repeat top left;
   height:301px;
   width:301px;
   position:relative;
   margin:0 auto;
   top:100%;
   -webkit-transition:2s ease all;
   -moz-transition:2s ease all;
   transition:2s ease all;
}
</style> 
 </head> 
 <body> 
  <div class="example"> 
   <div class="backgroundImage"></div> 
  </div>  
 </body>
</html>

Related Tutorials