make JPG load only on hover - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

make JPG load only 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">
.derp {<!--from   w w  w  . ja  v  a  2 s  .  c o  m-->
   margin:auto;
   background:Chartreuse;
   width:201px;
   height:201px;
}

.derp:hover {
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png')
}
</style> 
 </head> 
 <body> 
  <div class="derp"> 
  </div>  
 </body>
</html>

Related Tutorials