CodePen

HTML

            
              <figure>
  <img src="http://lorempixel.com/output/city-q-c-200-200-7.jpg" alt="">
  <figcaption>
    Picture
  </figcaption>
</figure>

<div class="show-me">
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>  
</div>

            
          
!
via HTML Inspector

CSS

            
              * {
  box-sizing:border-box;
}

figure, div {
  float:left;
  width:200px;
  height:200px;
  margin:25px;
}

div {
  padding:10px;
  background:grey;
}

img {
  display:block;
}

/* the above is just basic styling and not related to funtionality */

/* IMAGE EXAMPLE */

figcaption {
  width:inherit;
  height:inherit;
  text-align:center;
  line-height:200px; /* just to center the text in the box */
  display:none; /* hides it until needed */
  color:white;
 }

figure:hover figcaption {
  background-color: rgba(0,0,0,0.5);
  display:block; /* now you can see it */
  position:relative;
  top:-100%; /* moved to cover the image*/ 
}


/* DIV EXAMPLE */

.show-me {
  position:relative; /*needed to set positioning context */
}

.show-me:hover:after {
  content:"Insert Text Here";
  position:absolute;
  top:0;
  left:0;
  width:inherit;
  height:inherit;
  text-align:center;
  color:white;
  line-height:200px;
  background-color: rgba(0,0,0,0.5);
}
  

            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................