Last couples days I’ve been trying so hard to find how to remove gap/space between product description images on product page but none of them worked. I will be glad if anyone help me out here
Topic summary
A user is trying to remove gaps between images in their Shopify product descriptions, particularly on mobile view. The issue affects their product page layout at critterlamp.com.
Solutions Provided:
-
CSS modification approach: Multiple contributors suggested adding CSS code to the
base.cssfile targeting.product__description imgelements with properties likemargin: 0,display: block, andline-height: 0 -
Alternative method: One suggestion involved adding code to
theme.liquidfile above the</body>tag -
Mobile-specific fix: A media query solution was provided specifically for screens with max-width 750px, addressing both image margins and paragraph spacing
Outcome:
The user confirmed one solution worked perfectly. They then requested additional help to remove side margins on mobile view, and assistance was offered to continue troubleshooting.
The discussion includes code snippets, screenshots demonstrating the issue, and step-by-step instructions for accessing Shopify’s theme editor.
This is Noah from PageFly - Shopify Page Builder App
I can help you. Please can you provide password in your url website. Thank you.
Best regards,
Noah | PageFly
hello @thekidreyz
Password?
It is euiseok0201
Thanks ahead!
It is euiseok0201
Thanks ahead:)
@thekidreyz Please follow below steps to remove space/gap between images in product description. Let me know whether it is helpful for you.
- From admin go to “Online stores” → “Themes”
- Click action button from the current theme and select “Edit code”.
- Search for “base.css” file and paste the below code at the bottom of the file.
.product__description img {
display: block !important;
margin: 0px !important;
}
Result will be like,
Please provide your support by click “Like” and “Accepted” if our solution works for you. Thanks for your support.
Hi @thekidreyz
Hope the following instructions can help you:
- Based on the images you provided, it seems like you want these adjustments on mobile. Here are the instructions for you to achieve that.
Step 1. Go to Themes → Edit Code.
Step 2. "Find the file base.css . Add the following CSS snippet to the end of the file:”
@media screen and (max-width: 750px) {
.product__description p:last-child {
line-height: 0 !important;
margin: 0 -1.5rem !important;
margin-top: -2px;
}
.product__description p:last-child img {
margin: 0;
}
}
Here is the result: https://www.loom.com/share/0a9bf54b77264a6298562ddb4dbb44e6
We hope it will work for you. Please vote it as a solution if you find it helpful.
Thank you so much! It worked perfectly :)))
Thank you, have a nice day !






