image stretching
i dont want this image to stretch is there a way to prevent it if i only set its width then if height of image is larger it becomes very big and if width is larger it and i dont use fixed width it pushes the other elements
2 Replies
Try with
object-fit: cover
Hello,
Try this.....
img {
max-width: 100%;
height: auto;
display: block;
}
this makes images responsive, if the image is to big you need to resize the image.
A better way is to use something like a picture tag where you can create different size images for different breakpoints 😉
Hope this helps