I am looking to create two div
elements with 100% height.
The parent div
should display an image and adjust its size automatically.
The child div
should act as a color filter and maintain the same size as the parent div
even when the page is resized.
I have come across similar solutions online where the child div
either enlarges or shrinks compared to the parent div
when resizing the page.
.main_slide_back {
top: 0px;
left: 0px;
margin: -8px 0 0 -8px;
width: calc(100% + 16px);
height: 100%;
z-index: 1;
}
.main_slide_back:after {
content:'';
top: 0;
left: 0;
z-index: 2;
width: 100%;
height: 100%;
position: absolute;
background: #08598D;
opacity: 0.4;
}
.main_slide_back img {
width: 100%;
height: 100%;
}
Thank you in advance. Tobi