I'm having trouble creating a responsive square div with another responsive div inside it. No matter what I try, I can't seem to get it right without using media queries. I must be missing something, but I can't figure out what it is.
Here's what I'm aiming for:
https://i.sstatic.net/upLFO.png
Check out my code on Codepen
.image-exists {
width: 100%;
padding-bottom: 100%;
background-size: cover;
background-position: center;
background-image: url(https://icatcare.org/app/uploads/2018/07/Finding-homes-for-your-kittens-1.png);
border: 2px solid #8ABE57;
border-radius: 0.25rem;
}
.cover-image-flag:before {
content: "Text here";
position: absolute;
bottom: 0;
left:0;
background: #8ABE57;
padding: 5px;
text-align: center;
font-size: 1em;
width: 100%;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.1/css/all.min.css" rel="stylesheet"/>
<div class="col-lg-4 col-md-4 col-sm-5 col-xs-6 col-6 img-holder cover-image-flag">
<a href="#" class="delete-img-button">
<i class="fas fa-circle fa-stack-2x delete-img-circle"></i>
<i class="fas fa-times fa-stack-1x delete-img-icon"></i>
</a>
<div class="image-exists"></div>
</div>