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;
}