Answer the question
In order to leave comments, you need to log in
How to implement img smaller side resizing?
Good evening!
Given:
1. DIV with dimensions 100x100px and overflow: hidden;
2. img inserted into a DIV of indefinite size (clearly larger than 100x100px).
What you need: It is
necessary that the image completely fills the entire existing div while maintaining its proportions.
If img has a width > height, then the height becomes 100px, while the width adapts proportionally and some part of it that crawls out of the div area is not visible.
If img has width < height, then the width becomes 100px, the height adapts... and so on.
What exactly is needed:
So that the size of 100px is assigned to the smaller side of the img.
Thanks in advance for any help.
Sincerely,
Alexander.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question