css code to stop cropping but limit height on thumbnails
-
Hi
Please help me with css code to format my shop images correctly.
I have an affiliate marketplace with over 6,000 products and 100 merchants. The merchants provide the images in all different sizes and aspect ratios and it would be impossible for me to recreate and then constantly update each product image.
So I need a workaround please. I wish WooCommerce would add this as functionality on the plugin.
I need the full product to show in the block without being cropped and limited to 240px high.
The majority of the merchants provide images in an aspect ratio that is taller than wide so the images either get cropped, or show their full height which makes them huge and and the others with the correct aspect ratio are small so the shop is full of irregular sized images.
Currently I have the products set not to crop images. But the images are still being cropped.
Additional css used:
' .woocommerce ul.products li.product, .woocommerce-page ul.products li.product { text-align: center !important; margin-bottom: 2.5em; } @media (max-width: 525px){ .woocommerce ul.products li.product, .woocommerce-page ul.products { display: block } } /* Adjust thumbnails sizes */ .primary .attachment-woocommerce_thumbnail.size-woocommerce_thumbnail { height:240px !important; width: auto !important; max-width: 240px; margin: 0 auto !important; object-fit: contain !important; display: block; } .woocommerce ul.products li.product a img { width: auto; height: 270px; object-fit: cover; }
Thanks
Karen
The page I need help with: [log in to see the link]
- The topic ‘css code to stop cropping but limit height on thumbnails’ is closed to new replies.