Hi everyone,
I have a problem with the product cards inside my collection page. How Can I adjust the spacing in the desktop view without altering the spacing in my mobile view. See photo for reference.
Store Preview Link: https://bgtz765ufz7gbbgl-13830324282.shopifypreview.com
Topic summary
A user needed to add spacing between product cards on their collection page in Shopify’s Dawn theme, specifically for desktop view only without affecting mobile layout.
Initial Solution Provided:
- Add CSS code to
base.cssfile - Code:
li.grid__item.scroll-trigger.animate--slide-in { margin: 0 6px !important; } - This affected both desktop and mobile views
Final Solution:
- Wrap the CSS in a media query to target desktop only
- Code snippet:
@media (min-width: 990px) {
li.grid__item.scroll-trigger.animate--slide-in {
margin: 0 6px !important;
}
}
- Add to end of
base.cssfile in theme code editor
Status: Resolved - the media query solution successfully added desktop-only spacing while preserving mobile layout.
Hi @IntechCarl
You can try to follow this step
Step 1: Go to Edit code
Step 2: Find file base.css and add this code at the end of the file
li.grid__item.scroll-trigger.animate--slide-in {
margin: 0 6px !important;
}
Result
Best,
Liz
Hi @LizHoang Does it only affect the desktop view? Because I only want the desktop view to have the spacing.
Hi @IntechCarl
You can try to follow this step
Step 1: Go to Edit code
Step 2: Find file base.css and add this code at the end of the file
@media (min-width: 990px) {
li.grid__item.scroll-trigger.animate--slide-in {
margin: 0 6px !important;
}
}
Thank you @LizHoang This one works!

