Add a third background image to an element on hover - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image

Description

Add a third background image to an element on 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">
.hover {<!-- w w  w.j  a v a 2 s .  co m-->
   height:100px;
   width:100px;
}

#one {
   background:url('http://www.java2s.com/style/demo/Google-Chrome.png') no-repeat, url('http://www.java2s.com/style/demo/Google-Chrome.png') no-repeat;
}

#two {
   background:url('http://www.java2s.com/style/demo/Google-Chrome.png') no-repeat, url('http://www.java2s.com/style/demo/Google-Chrome.png') no-repeat;
}

.hover:hover {
   background:url('http://www.java2s.com/style/demo/Google-Chrome.png') no-repeat !important;
}
</style> 
 </head> 
 <body> 
  <div id="one" class="testone hover"></div> 
  <div id="two" class="testtwo hover"></div>  
 </body>
</html>

Related Tutorials