I am trying to give my product images a uniform height without changing the intrinsic size of the images. I have achieved it with the styling below:

            width: auto !important;
            height: 163px !important;
            object-fit: contain !important;
            margin-bottom: 0!important;

However, they share the same class as the product images on cart-contents which applies the above styling too. They also share the same class size-woocommerce_thumbnail which would also not change the outcome.

I then tried to check the style tab on the right side of Dev Tools. and tried checking all of the classes that are under the product images. I have changed the class of the above styling with .woocommerce ul.products li.product a img but the only problem is I that there is a plugin with a function that attaches an image to product image hooks on the archive page and has its own styling but the images do not share the same name class as the other images and those images attached on the hook also increases in size the same as the product images but should not.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.