I have an image with the size of 10143x1963. In my CSS I set the height of image on 400px because otherwise the image will take to much space on my website. As you can see by the resolution, the image is very wide because it's a panoramic photograph. I would like to put this image as header on my website with the height of 400px but that the width can change but doesn't get bigger than the other elements on my website. I set the width of the image on 100% using CSS but when I resize my webpage then it squeezes the image together which makes everything on the image not in the right proportion. What I need is that the image gets cut off on the right so it doesn't sqeeuze but is resizeable with the height of 400px. I hope somebody could help me with this.
TL;DR: How to automaticly resize an image with the height of 400 px and the width of 100% but keep the proportions?
Aucun commentaire:
Enregistrer un commentaire