Switch background image when hover - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image

Description

Switch background image 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">
.rollovericons a#terms {
   display:block;
   width:139px;
   height:28px;
   background:url('http://www.java2s.com/style/demo/Google-Chrome.png') no-repeat;
}

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

.rollovericons a#contact {
   display:block;
   width:139px;
   height:28px;
   background:url('http://www.java2s.com/style/demo/Google-Chrome.png') no-repeat;
}

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

.space {<!--from  w w  w. j a v a  2s.  c  o m-->
   margin-bottom:16px;
}
</style> 
 </head> 
 <body> 
  <div class="rollovericons"> 
   <a href="" class="space" id="terms"></a> 
   <a href="" id="contact"></a> 
  </div>  
 </body>
</html>

Related Tutorials