I am trying to have an overlay effect on a responsive image using CSS3 and bootstrap3. The problem is that the rollover brings an overlay background which applies on margins, so bigger than the image itself.
Here is my html:
<div class="col-sm-6 col-md-4 col-lg-3">
<figure>
<a href="#">
<img class="img-responsive" src="img/portfolio/prw-4.jpg">
</a>
</figure>
</div>
And the CSS:
#portfolio figure a:after {
content:'Text';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
transition: all 1s;
-webkit-transition: all 1s;
background: rgba(0,0,0,0.7);
color: #FFF;
text-align: center;
padding: 60px 0;
}
#portfolio figure a:hover:after {
opacity:1;
}
Does anyone have a suggestion? Thanks