Skip to content Skip to sidebar Skip to footer

Show Title Tag On Hover Inside Img


Solution 2:

Here is an easier way. You just use :after pseudoelement on hover. Pure CSS solution

<a href="" class="img"></a>

.img{
  display: block;
  width:200px;
  height:200px;
  background: url('http://i.stack.imgur.com/Sjsbh.jpg');
  background-size: 200px 200px;
  position: relative;
}
.img:hover::after {
  content:'This is a description';
  position: absolute;
  width:100%; 
  height:20%;
  bottom:0; left:0;
  background: rgba(255, 255, 255, 0.8);
 }

You won't very specific. I hope it will help. You can also make a tooltip.


Post a Comment for "Show Title Tag On Hover Inside Img"