Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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
Hello all,
I want to make images of products fit the box on homepage and product page.
Store URL: https://u7yeji-na.myshopify.com
@Mamdouh_USD , hey, thanks for posting here.
Please add this CSS in the custom CSS box in the customizer.
.card__media .media img {
object-fit: contain;
background: #fff;
}
Hi @Mamdouh_USD ,
To adjust the image, go to Online store >> Customize >> click on Featured collection or collection and change the image ratio to Adapt to image which will automatically display whole image according to width.
If you stuck somewhere, feel free to message me or reply here. All the collections settings are same for both the home page and collection page.
@Mamdouh_USD Basically, on the product page, the image doesn't get cropped. The image is perfectly appearing. Can you please share the screenshot?
On mobile view, the image gets cropped. You can check it.
@Mamdouh_USD Please add the below code at Online store >> Edit code >> add to theme.css or base.css or go to Online store >> Customize >> Settings >> Custom CSS and paste the below CSS.
@media screen and (max-width: 749px) {
.product__modal-opener {
height: 100%;
}
}