A Shopify store owner is experiencing inconsistent spacing between product page slider images—some products show visible gaps while others have images touching directly. This affects mobile display particularly.
Proposed Solutions:
Multiple respondents suggest adding custom CSS code to standardize the gap:
Location: Online Store → Themes → Edit Code → base.css, theme.liquid, or component-product.css (varies by theme)
Method: Insert CSS targeting .product__media-thumbnails with display: flex and a consistent gap value (6-8px recommended)
Key properties: Override existing margins/padding with !important, use flex-wrap: nowrap for horizontal scrolling
Mobile-specific fix: Wrap the CSS in a media query (@media screen and (max-width: 768px)) to adjust gap size for smaller screens.
The issue likely stems from inconsistent image dimensions or theme-specific spacing variations in Flexbox/Grid layouts. The discussion remains open pending confirmation from the original poster on whether the solutions resolved the problem.
Summarized with AI on October 28.
AI used: claude-sonnet-4-5-20250929.
I’m facing an issue with the image slider under the main product photos on my Shopify store. For some products (for example, Flower ring), there is a small visible gap between the images in the slider. However, for other products, the images in the slider are directly touching each other, without any gap.
I would like the gap between the images to be consistent across all products, no matter which device (especially mobile) a customer is using.
Does anyone know which code I could add to make sure that the spacing between the images in the product page slider is always the same?
if you want to lock in even spacing for all your slider pics, go to Online Store > Themes > Edit code and open your main CSS file.
look for the selector that wraps each slide (it might be called something like “slide” or “carousel-item”) and give it a consistent right (or bottom) margin—whatever feels right for your design.
Save your changes, refresh a few product pages on mobile and desktop, and you should see the same gap everywhere.
It sounds like your product image thumbnails (slider) are styled inconsistently—possibly due to different image sizes or variations in how the theme applies spacing (margin/padding) between them. This is common in themes like Dawn or custom ones using a Flexbox or Grid layout.
To fix this and make the gap uniform across all product pages and devices, you can add some custom CSS.
Try This Custom CSS:1. Go to:
Online Store → Themes → … → Edit Code
Open this file:
assets/base.css or assets/component-product.css (The exact file may vary depending on your theme version)
Scroll to the bottom and add this code:
css
CopyEdit
.product__media-thumbnails {
display: flex;
gap: 8px; /* Adjust the gap as needed */
flex-wrap: nowrap;
overflow-x: auto;
}