Using just CSS, crop .img keeping aspect without distortion
问题 I have an image that has been placed inside a div. The div is 600 width and has a variable height. I want my image to sit at the top of the div. If I make the width 590 the issue is that the image is then too high in terms of design and it looks too dominant on the page (because its ratio is roughly 4:3 etc). So I want to make the image 590 by 200. If i use... .img { width: 590px; max-height: 200px; } ...then the image sits inside the div exactly how I want it. However, the photo itself is