Show text over a image when hovering over it - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover Image

Description

Show text over a image when hovering over it

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">
span {<!--from ww  w  .  ja  v a2  s.c  om-->
   display:none;
}

img {
   width:501px;
}

img:hover~span {
   display:inline;
}
</style> 
 </head> 
 <body> 
  <img src="https://www.java2s.com/style/demo/Opera.png"> 
  <br> 
  <span>Lore</span>  
 </body>
</html>

Related Tutorials