Is there something wrong with my overlay on this image? It darkens when I mouse over, but the text I want to display does not show up. Any ideas?
HTML
<div class="square">
<div class="info">
<h2>This is a test</h2>
</div>
<div class="bg-image img-responsive square" style="background-image:url(http://lorempixel.com/500/500/sports/)"></div>
</div>
CSS
.square{
width: 100%;
height: 0;
padding-bottom: 100%;
}
.bg-image{
background-position: center;
display: inline-block;
position: relative;
text-align: center;
cursor: pointer;
background-repeat: no-repeat;
background-size: cover;
color: rgba(255,255,255,1);
transition: color .25s ease;
}
.bg-image:before{
position: absolute;
content: " ";
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
z-index: 0;
transition: opacity .25s ease;
background-color: rgba(0,0,0,0.75);
}
.info{
z-index: 100;
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
pointer-events: none;
height: 200px;
text-align: center;
color: rgba(255,255,255,1);
opacity: 0;
transition: opacity .25s ease;
}
.bg-image:hover:before, .bg-image:hover:before .info{
opacity: 1;
}