3 grid based boxes of size 16:9 covering whole width of page should display picture in this divisions without compressing/distorting also showing the full picture. If the picture is bigger than the box then it should cover full width or full height depending on which dimension is larger and accordingly resize the other dimension.
My first issue is : I give 100% width to each of the div inside the grid, but how much should i assign the height dimension?
Second : Assuming i have the divisions according to my requirements, how do i display the picture inside the division?.
Current progress: i have used this website for reference: dabblet and used code where thumbnail-card is my div and thumbnail is my image.
.thumbnail-card {
height: 300px;
width: 100%;
background-color: black;
display: table-cell;
vertical-align: middle;
text-align: center;
}
.thumbnail-card:before {
content: "";
width: 1px;
height: 100%;
display: inline-block;
vertical-align: middle;
margin-left: -1px;
}
.thumbnail {
max-height: 100%;
max-width: 100%;
display: inline-block;
vertical-align: middle;
}
but vertically long images don't behave as i need. Any solutions? Pics for reference: vertical_pic horizontal_pic how it looks