I'm currently working on a responsive website where I am trying to resize images using the CSS property transform:scale. It's important to me to maintain the aspect ratio of the images, so I have created two separate classes - one for landscape images and one for portrait images.
Here is the HTML code:
<img class="landscape" src="" width=100%; height=100%>
<img class="portrait" src="" width=100%; height=100%>
And here is my corresponding CSS:
img.landscape { transform:scale(0.745,0.671);}
img.portrait { transform:scale(0.671,0.745);}
The landscape images are being scaled correctly, but I am encountering issues with the portrait images not being scaled properly.
Can someone please help me identify where I may be making a mistake? Additionally, I would like to create a third class specifically for square-format pictures.
Thank you in advance for your assistance.
-Cevin