I have a client who is requesting a sold text to be displayed on top of all images that have been sold, positioned in the bottom left corner of each image. While I have successfully implemented this feature, the issue arises when dealing with images of varying sizes. Is there a universal CSS class that can be utilized to ensure the text is correctly positioned regardless of the size of the image?
The Code:
.sold-overlay {
position: absolute;
top: 80%;
left: 59%;
width: 25%;
border: 1px solid #e60000;
color: white;
font-size: 50%;
background-color: red;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<div class="modal-body">
<h2>I Am Travon Martin</h2>
<img class="img-responsive img-centered" src="img/portfolio/sold/img-6847.jpg" alt="">
<h2 class="sold-overlay">Sold</h2>
<p>I'm sorry, this artwork has been sold to a happy customer.</p>
<button type="button" class="btn btn-primary" data-dismiss="modal"><i class="fa fa-times"></i> Close Project</button>
</div>
</div>
</div>
</div>