Hello, could anyone explain why some of my products have incorrect placement on the website? is there a code for that to fix it? it doesn’t look good
thanks in advance
A user reported misaligned product displays on their collection page, where some items appeared taller than others, creating an inconsistent grid layout. Screenshots revealed the issue stemmed from mixing square and portrait-oriented product images.
Root Cause:
Product cards maintain uniform width but vary in height based on image aspect ratios, causing portrait images to display taller than square ones.
Solution Provided:
Two CSS-based fixes were offered:
</body> tag).card__inner.ratio {
--ratio-precent: 100 !important;
}
.card__inner img {
object-fit: contain !important;
}
Outcome:
The original poster confirmed the solution worked successfully. The discussion is resolved.
Hello, could anyone explain why some of my products have incorrect placement on the website? is there a code for that to fix it? it doesn’t look good
thanks in advance
Hey @Monness
Follow these Steps:
Go to Online Store
Edit Code
Find theme.liquid file
Add the following code in the bottom of the file above tag
RESULT:
If I managed to help you then, don’t forget to Like it and Mark it as Solution!
Best Regards,
Moeed
Hi there. Some of your product images are square and some are portrait.
All product card images have the same width, so portrait ones will be show taller.
You may check this post – it is about the same issue: https://community.shopify.com/c/shopify-design/images-in-dawn-theme-are-not-the-same-size-or-too-large/m-p/2985676#M781637
But your theme has different name, so may have some differences…
If your theme does not have similar selector, you can another rule to the code suggested there, so it looks like this:
.card__inner.ratio {
--ratio-precent: 100 !important;
background: transparent;
}
.card__inner img {
object-fit: contain !important;
}
Hi, thank you for your reply. It worked like a charm! Thank you so much
Thank you for your reply. I’m glad to hear that the solution worked well for you. If you require any more help, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated.