V
V
vladislav9972020-04-15 15:16:43
css
vladislav997, 2020-04-15 15:16:43

How to properly display photos in a 100x100px container without deformation if they are all different sizes?

Tell me, let's say there is a div with dimensions of 100x100px, different pictures with different sizes. If you simply display them and specify the size 100x100, they are deformed. And how to make them so that their width is stretched to 100 pixels, but the height is cut off (like cropped)?

Just as an example:

<div style="width:100px;height:100px">
<img src="...">
</div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iBird Rose, 2020-04-15
@vladislav997

useobject-fit: cover;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question