I am trying to place a set of images with varying heights and widths inside a div
tag. My goal is to have the images maintain a fixed height, unless the width surpasses a certain limit, in which case I want the height to adjust while preserving the aspect ratio. Initially, I attempted the following CSS:
.ArtistPic
{
height: 660px;
max-width: 720px;
}
While this code fixes the height, it distorts the image horizontally when the width exceeds 720px, failing to preserve the aspect ratio. Any suggestions on how to achieve this as intended?
Edit: To clarify, what I'm looking for is a way for the image to enlarge up to one of the specified sizes while maintaining its original aspect ratio.