As I know, the <img/> have css prop: object-fit.
When value is contain: img will be display full, and there is white space (if the ratio of image is different from <img/>).
Now. I have a div, has a ratio 3/2. The parent is an div with height and width is dynamic, and no ratio for parent.
How can the children always inside the parent (contain) in any ratio of parent?
You can set
img { max-width: 100%; max-height: 100%; }: