How to change the image size in the output?

Display pictures of goods, all of them with different height and width. How to make pictures automatically, as it were nearer, and became 250х250? and not distorted. Adaptability is also a good idea to keep
July 9th 19 at 12:48
2 answers
July 9th 19 at 12:50
Solution
the <div><img src="picture.PNG"></div>

div {
overflow: hidden;
width: 250px;
height: 250px;
}
img {
height:100%;
}

You can even make it a background, but then the search engines will not see it, and that is bad
but if width is less than height? - Durward_Osinski commented on July 9th 19 at 12:53
: JS help - Nikita20 commented on July 9th 19 at 12:56
and what about adaptability? - Kendrick_Schu commented on July 9th 19 at 12:59
: then it's not the solution - Durward_Osinski commented on July 9th 19 at 13:02
: css supports media - Nikita20 commented on July 9th 19 at 13:05
a js beauty - Nikita20 commented on July 9th 19 at 13:08
July 9th 19 at 12:52
For such purposes should not layout to fit under the image and the image under design.
Take all the pictures and cropping as necessary
Put on downloading images script, so a new picture is also cut off.

This is the best and most logical way, though in the beginning it is a bit labor-intensive

Find more questions by tags CSSHTMLImages