Scale Image and Keep Aspect Ratio Using Only CSS

I’ve had a lot of WordPress themes that set a max-width for a post image, only to squash the image and make it look stretched. I looked high and low for a fix, here it is:

max-width: 100%;
height: auto;

source

Leave a Reply