Hover text and replace with image - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover Image

Description

Hover text and replace with image

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">
.fancy {<!--from www .ja  va2  s  . c  o  m-->
   display:block;
   width:456px;
   height:316px;
   background:Chartreuse;
}

.fancy:hover {
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png')
}

.fancy:hover .text {
   display:none;
}
</style> 
 </head> 
 <body> 
  <a class="fancy"> <span class="text">Lore</span> </a>  
 </body>
</html>

Related Tutorials