I have a wrapping div that contains an image and an overlay.
I want the image to appear 100% the width and height of the wrapping div.
I also want the overlay to appear 100% the width and height of the wrapping div and appear on top of the image.
I have got this working but for one thing: when I resize the browser to small screens, the overlay div appears slightly higher than the image.
Would anyone know what's going on and how I could ammend this?
My code is:
<div class="banner-slide">
<div class="banner-slide__overlay"></div>
<img src="dist/images/banner-image.png" class="banner-slide__image">
</div>
SCSS:
.banner-slide {
max-height: 670px;
overflow: hidden;
position: relative;
&__overlay {
background: #333;
opacity: .4;
height: 100%;
position: absolute;
width: 100%;
z-index: 99;
}
&__image {
height: 100%;
width: 100%;
}
}