This is my initial inquiry, so I apologize if the formatting is incorrect.
Despite attempting various methods from Stack Overflow, I am still unable to properly display this content vertically centered.
CSS:
div.img-wrapper {
display: table;
height: 232px;
overflow: hidden;
position: relative;
width: 100%;
}
div.cover {
display: table-cell;
height: 232px;
left: 0;
margin: 0;
overflow: hidden;
padding: 0;
position: absolute;
text-align: center;
top: 0;
vertical-align: middle;
width: 100%;
}
HTML Markup:
<div class="img-wrapper">
<img alt="" src="img2.jpg">
<div class="cover">
<img alt="" src="img1.png">
<span class="product-name">Product Name</span>
<span class="product-sub">Sub Line</span>
</div>
</div>
I've opted for position:absolute
as the .cover
div overlays the image to display product details.
Any assistance on this matter would be deeply appreciated :)
Thank you very much in advance.
Sincerely, Will