I'm having trouble displaying an overlay text that should look like: https://i.sstatic.net/GccZy.jpg
This is what I've tried:
<div class="row">
<div class="col-md-3 program-cat">
<img src="<?php echo EF_THEME_BASE_URL; ?>/images/infants.jpg" >
<div class="program-desc">
Short description of Aqua Aerobics goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam posuere, mi at pharetra tincidunt, odio ante eleifend ante, a aliquam odio urna nec nisl. Duis fermentum congue ultricies. Sed id aliquet augue.
<a class="btn button" href="#">Learn to Swim</a>
<span>Infants Program</span>
</div>
</div>
</div>
Here's my CSS:
#program-cats .program-cat {
width: 460px;
height: 100%;
position: relative;
}
#program-cats .program-cat img {
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
}
#program-cats .program-cat .program-desc {
position: absolute;
bottom: 0;
left: 50%;
transform: translate( -50%, -50%);
color: white;
text-align: center;
background-color: rgba(31, 127, 134, 0.5);
padding: 5px 0;
border-top: 1px solid #FFFFFF;
}
I'm struggling to achieve the layout as shown in the image.
Any assistance would be greatly appreciated.