Is there a css-only solution to scale an image into a bounding box (keeping aspect-ratio)? This works if the image is bigger than the container:
img { max-
Are you looking to scale upwards but not downwards?
div { border: solid 1px green; width: 60px; height: 70px; } div img { width: 100%; height: 100%; min-height: 500px; min-width: 500px; outline: solid 1px red; }
This however, does not lock aspect-ratio.