All things Shopify and commerce
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Anyone know how to make images in product page smaller when you click on them to pop up and expand
do you mind sharing URL of the product OR you do a video for clarity. and this can be just an effect
Hello here is the url
https://zenfactr.com/products/vibrating-massage-ball-for-muscle-pain-relief
Hello @Ecomowner
/* Resize product image popup modal */
.media-modal__content img {
max-width: 70vw; /* Controls how wide the image is on desktop */
max-height: 70vh; /* Controls height */
object-fit: contain;
}
Adjust the 70vw and 70vh to suit your needs. lower numbers = smaller image.
Hi, this did not work
If the previous CSS didn’t work, it might be due to how your theme handles modal images. Try this more specific CSS with !important to override the modal image size:
.media-modal__content,
.media-modal__content img,
.media-modal__content .media {
max-width: 600px !important;
max-height: 600px !important;
width: auto !important;
height: auto !important;
margin: auto;
object-fit: contain;
}
Add it at the very bottom of your base.css or component-product.css file and check again. Let me know if it still doesn’t show up might be worth checking if the modal is JS-rendered in a way that delays styling.