I want to make these images using css to be same height with perfect width and have no space between them and also i want them to look perfect
<div id="pic">
<img src="images/model1.jpg" class="modelsimg">
<img src="images/model2.jpg" class="modelsimg">
<img src="images/model3.jpg" class="modelsimg">
anyone to help me with my problem
2
Answers
To make the images the same height with perfect width and no space between them, you can use CSS to style the images and their container. Here’s an example of how you can achieve this:
I am guessing that the intrinsic dimensions of the images will vary but you want them to be displayed with matching dimensions. This can be done with the object-fit property. Do you want the images to stretch to fit or have the edges cropped to fit?
In this example using
object-fit: cover
, the shorter image is enlarged so that all images have the same height, and the left and right sides are cropped evenly to have matching widths.