I'm looking for a solution to resize my <img>
element with CSS:
- Must keep aspect ratio for landscape and square and portrait images
- Must work in upscale (shrinking) and downscale (stretching) scenarios
- In addition to Chrome/FF/Safari/Opera must also work in IE 10/Edge (IE 8+ support is nice to have)
None of the solutions (like this or this) I found here works as required. The best one that uses object-fit: contain
does not work in IE. Is it doable without javascript?