Maintain aspect ratio for images

If you have an image and are setting the size via CSS, make sure you constrain in only one axis (one direction) - either height or width. Let the other direction scale as appropriate.

Otherwise you will squish or stretch your image.

See the Pen Aspect Ratio and Object Fit - Avoid distorting images! by David Heitmeyer (@dpheitmeyer) on CodePen.