Reputation: 546
I'm working on getting images to resize depending on the clients browser (desktop vs mobile).
I've put in place max-width:100%, images are formatted identically, 900x900 px, but some of them overstretch the width and some don't.
Examples of this are (in mobile);
Its a wordpress site and its setting the width explicitly in HTML, which I believe is causing the problem.
My question is will the CSS width / height override the HTML property settings? And if not, how does one stop Wordpress setting the HTML properties for width and height?
Upvotes: 0
Views: 933
Reputation: 2204
Your theme has a weird setting that adds width property to each product. It was different for the products you mentioned.
I limited the width of the div by adding max-width:100vw
for this class woocommerce-product-gallery__image
, which seems to do the job but you need to find out why different inline width properties are added to different products even though they have same 900x900 image sizes.
Upvotes: 1