I need help in aligning product cards like the alignment is off. kindly help
the alignment is off
A Shopify store owner is experiencing misaligned product cards on their site (trendlabb.com), where cards display at inconsistent heights.
Initial Problem:
Solutions Provided:
Multiple community members offered CSS code solutions involving:
-webkit-line-clamp: 2 to limit title text to 2 lines with ellipsis.swiper-slide height propertiesmin-height on product card titlesCurrent Status:
The title truncation is working, but a new issue emerged: product cards with larger images still display at different heights. The user is seeking a solution to ensure all product cards maintain uniform height regardless of image size.
Discussion remains open with the height consistency issue unresolved.
Hi @ncsjcnjs l,
Thank you for reaching out to the Shopify community. I’d be glad to assist you. Could you kindly share your store URL and
password (if it’s password-protected) so I can review it and provide you with an update?
Hi @ncsjcnjs ,
please share your store Url .
Also, kindly tell me how could my product title in featured collection appear as … after taking two lines. i mean it takes 2 lines and then ellipes (…) appears.
Hi @ncsjcnjs ,
Go to Online Store, then Theme, and select Edit Code.
Search for base.css/theme.css/style.css/main.css/custom.css file Add the provided code at the end of the file.
a.product__card-title--link {
display: -webkit-box !important;
-webkit-line-clamp: 2; /* Maximum 2 lines */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
}
.swiper-slide {
height: auto !important;
}
Or
a.product__card-title--link {
display: -webkit-box !important;
-webkit-line-clamp: 1; /* Maximum 2 lines */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
}
.swiper-slide {
height: 100% !important;
}
How to Add This to Shopify YourYour Theme:
Alternative (Edit Theme CSS Directly):
.product__card-title--link {
display: -webkit-box;
-webkit-line-clamp: 2; /* Limit to 2 lines */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis; /* Adds "..." at the end if text is cut */
min-height: 33px;
}
If you found this helpful, we’d really appreciate it if you could give it a thumbs up and mark it as the solution!