Tuesday 8 December 2020

Image max height and max width while preserving aspect ratio

Is it possible to give max-height and max-width to an image while preserving aspect ratio without using js?

For example, I want an image to be with a height of 38px and the width auto. If the width is higher than 200px, I want the width to be 200px and the height auto.

If it's not possible without js, does anyone have an idea how to do it with js and without resizing the image after it's already loaded?



from Image max height and max width while preserving aspect ratio

No comments:

Post a Comment