I'm attempting to automatically adjust the height and width of the parent div that contains three stacked images, but the parent is not adjusting to the dimensions of the content. Even when the div and the last image are on the same z-index, it's causing issues. Here's an illustration of what's happening and what I'd like: I need it to be responsive so I can't use static values. Illustration Link
Here's my code:
.image_holder {
margin-top: 5em;
overflow: visible;
background-color: red;
display:block;
z-index: -12;
position:relative;
border-style: solid;
border-width: 5px;
border-color:red;
}
.image_preview_parent {
position: absolute;
}
/*----------layers start---------*/
.layer_Back {
z-index: -12;
}
.layer_Camera {
z-index: -11;
}
.layer_Logo {
z-index: -10;
}
<div class="image_holder">
<img class="image_preview_parent layer_Logo" src="https://www.transparencyatwork.org/assets/fallback/employers/logo/thumb_default-9fbd6d06cb43649ddc8bfd34eb4b1192396a73474ce3c27cb5830b9edf86ae23.png" />
<img class="image_preview_parent layer_Camera" src="https://freepngimg.com/thumb/sunglasses/14-2-sunglasses-transparent-thumb.png" />
<img class="image_preview_parent layer_Back" src="https://d33wubrfki0l68.cloudfront.net/673084cc885831461ab2cdd1151ad577cda6a49a/92a4d/static/images/favicon.png" />
</div>