After last update (v9.4.1) he proportions of the images in the loop have changed
-
After a recent woocommerce plugin update, I noticed that the aspect ratio of the images in the loop changed. Until now, I had square graphics (the original 1:1 aspect ratio of the product images), but an additional “auto” parameter has arrived in the html code generated by the WC plugin:
<img src=“...” .... sizes=“auto, (max-width: 300px) 100vw, 300px”>
Because of this, the image still has a height of 150px, which I set in the CSS style max-height: 150px;, but it stretches to 100% of the width of the available space in the tag of the product list.
My styles for the image:
img {
width: auto;
height: auto;
max-height: 150px;
margin: auto;
display: block;
}Not even adding aspect-ratio: 1/1 helps;
This was not there before. Only when I remove the word “auto” from the
tag does the image take the correct aspect ratio again.
On desktop devices I can set max-width: 150px; permanently, but on mobile devices it is impossible, due to different screen resolutions.
- You must be logged in to reply to this topic.