I have a background image and on top of it is an overlay, I want the overlay to match the background image's height responsively, most I can manage is to match the height of the section, any ideas?
html
<section class="section">
<div class="bg-img">
<div class="overlay">
<p>This is a text on the overlay</p>
</div>
</div>
</section>
css
.section {
width: 100%;
height: auto;
min-height: auto;
}
.bg-img {
background: url('/static/img.jpg');
background-repeat: no-repeat;
background-position: top center;
background-size: 80%;
}
.overlay {
width: 600px;
height: 100%;
background-color: rgb(0,0,0,0.07);
margin-left: auto;
margin-right: auto;
text-align: center;
}