Struggling to align a table cell element both horizontally and vertically? Currently, only managing the vertical alignment.
The images vary in size, calling for fluidity and compatibility with max-height and width...
Custom Style Sheet (CSS)
.prod-img {
display: block;
margin: 20px;
border:1px solid black;
}
.prod-img a {
max-width: 170px;
height: 150px;
display: table-cell;
vertical-align: middle;
}
.prod-img img {
width: auto;
max-width: 100%;
height: auto;
max-height: 100%;
max-height: calc(100% - 30px);
margin: 0 auto;
}