Stack images and separate them with animation when hover - HTML CSS CSS Animation

HTML CSS examples for CSS Animation:Image

Description

Stack images and separate them with animation when hover

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

.mySlides {<!--from  w  w  w  .  j av  a2 s .c o m-->
   position: relative;
}
.mySlides img {
   position: absolute;
   top: 0;
   left: 0;
   max-width: 300px;
   transition: left 1.2s ease-in-out;
}
.mySlides:hover img:last-child {
   left: 300px;
}


      </style> 
 </head> 
 <body> 
  <div class="mySlides"> 
   <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> 
   <img src="https://www.java2s.com/style/demo/Opera.png"> 
  </div>  
 </body>
</html>

Related Tutorials