Answer the question
In order to leave comments, you need to log in
How to set the maximum width and height of an image in CSS while maintaining aspect ratio?
So it goes.
It is necessary to somehow prohibit the image from changing its proportions, but how?
Answer the question
In order to leave comments, you need to log in
img{
max-height: 200px;
max-width: 200px;
heigth: auto;
width: auto;
}
background-size: cover;
https://jsfiddle.net/psr1919plus21/5khsp9qt/1/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question