My image-generating algorithm produces images of various sizes, some tall and some wide. How can I ensure that the images always fit perfectly within their parent container? They should be 100% height if they are tall and 100% width if they are wide.
.image-container{
width: 75rem;
height: 50rem;
}
/**I need a solution that actually works**/
img{
max-width:100%;
max-height:100%;
}